Execute a query that returns a single int field.
438629
public int queryForInt(String sql) throws SQLException {
		Number number = queryForObject(sql, Integer.class);
		return (number != null ? number.intValue() : 0);
	}
607673
def from_db_value(self, value, expression, connection, context):
		
		if value is None:
			return value
		if _using_signed_storage():
			value = _signed_to_unsigned_integer(value)
		return value
1140694
def hsetnx(self, key, field, value):
        """"""
        return self.execute(b'HSETNX', key, field, value)
413301
def query_fetch_one(self, query, values):
        
        self.cursor.execute(query, values)
        retval = self.cursor.fetchone()
        self.__close_db()
        return retval
798280
def get(self, field=None, index=None, lpar=0, prompt=1, native=0, mode="h"):
        """"""

        if field and field != "p_value":
            # note p_value comes back to this routine, so shortcut that case
            return self._getField(field,native=native,prompt=prompt)

        # may prompt for value if prompt flag is set
        if prompt: self._optionalPrompt(mode)

        if index is not None:
            raise SyntaxError("Parameter "+self.name+" is not an array")

        if native:
            rv = self.value
        else:
            rv = self.toString(self.value)
        return rv
280193
public int getField(int index, int defaultValue)
	{
		if (index >= 0 && index < this.version.length)
		{
			return version[index];
		}
		else
		{
			return defaultValue;
		}
	}
1175929
def coerce_to_int(val, default=0xDEADBEEF):
    """"""
    try:
        return int(val)
    except (TypeError, ValueError):
        if default != 0xDEADBEEF:
            return default
        return val
1040785
private static int querySingleInteger(Connection connection, String sql,
			String[] args, boolean allowEmptyResults) {

		int result = 0;

		Object value = querySingleResult(connection, sql, args, 0,
				GeoPackageDataType.MEDIUMINT);
		if (value != null) {
			result = ((Number) value).intValue();
		} else if (!allowEmptyResults) {
			throw new GeoPackageException(
					"Failed to query for single result. SQL: " + sql);
		}

		return result;
	}
620781
def get_one(self, schema, query=None, **kwargs):
        
        ret = self._get_query(self._get_one, schema, query, **kwargs)
        if not ret: ret = {}
        return ret
895970
private int getIntValue(String str, int defaultValue) {

        try {
            int intValue = Integer.parseInt(str);
            return (intValue > 0) ? intValue : defaultValue;
        } catch (NumberFormatException e) {
            // intentionally left blank
        }
        return defaultValue;
    }
1014138
public int getInt(String key) {
    	String value = get(key);
    	Utils.require(value != null, key + " parameter is not set");
    	try {
    		return Integer.parseInt(value);
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException(key + " parameter should be a number");
        }
    }
916657
public Integer queryInt(String paramName, Integer defaultValue) {
        return this.request.queryInt(paramName, defaultValue);
    }
573619
public int getInt( int index ) throws OdaException
	{
		Integer value = (Integer) getFieldValue(index);
        return value==null?0:value;
	}
1325553
def make_int(value, missing=-1):
    """"""
    if isinstance(value, six.string_types):
        if not value.strip():
            return missing
    elif value is None:
        return missing
    return int(value)
1022418
public int getInt(int key)
    {
        Object value = map.get(key);
        if (!(value instanceof Integer))
        {
            return 0;
        }
        Integer result = (Integer)value;
        return result;
    }
529228
@Override
    public int getInt(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        final int index = indexForColumnName(key);
        return index >= 0 ? getInt(index) : 0;
    }
613210
def get_int(self, key, default=None):
        
        value = self.get(key, default)
        return None if value is None else int(value)