Java Code Examples for com.j256.ormlite.support.DatabaseResults#getInt()

The following examples show how to use com.j256.ormlite.support.DatabaseResults#getInt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseDaoImplTest.java    From ormlite-core with ISC License 5 votes vote down vote up
@Override
public Foo mapRow(DatabaseResults databaseResults) throws SQLException {
	Foo foo = new Foo();
	String[] columnNames = databaseResults.getColumnNames();
	for (int i = 0; i < columnNames.length; i++) {
		if (columnNames[i].equalsIgnoreCase(Foo.ID_COLUMN_NAME)) {
			foo.id = databaseResults.getInt(i);
		} else if (columnNames[i].equalsIgnoreCase(Foo.VAL_COLUMN_NAME)) {
			foo.val = databaseResults.getInt(i);
		} else if (columnNames[i].equalsIgnoreCase(Foo.STRING_COLUMN_NAME)) {
			foo.stringField = databaseResults.getString(i);
		}
	}
	return foo;
}
 
Example 2
Source File: DerbyEmbeddedDatabaseType.java    From ormlite-jdbc with ISC License 4 votes vote down vote up
@Override
public Object resultToSqlArg(FieldType fieldType, DatabaseResults results, int columnPos) throws SQLException {
	return results.getInt(columnPos);
}
 
Example 3
Source File: DateIntegerType.java    From ormlite-core with ISC License 4 votes vote down vote up
@Override
public Object resultToSqlArg(FieldType fieldType, DatabaseResults results, int columnPos) throws SQLException {
	return results.getInt(columnPos);
}
 
Example 4
Source File: EnumIntegerType.java    From ormlite-core with ISC License 4 votes vote down vote up
@Override
public Object resultToSqlArg(FieldType fieldType, DatabaseResults results, int columnPos) throws SQLException {
	return results.getInt(columnPos);
}
 
Example 5
Source File: IntegerObjectType.java    From ormlite-core with ISC License 4 votes vote down vote up
@Override
public Object resultToSqlArg(FieldType fieldType, DatabaseResults results, int columnPos) throws SQLException {
	return (Integer) results.getInt(columnPos);
}
 
Example 6
Source File: BooleanIntegerType.java    From ormlite-core with ISC License 4 votes vote down vote up
@Override
public Object resultToSqlArg(FieldType fieldType, DatabaseResults results, int columnPos) throws SQLException {
	return results.getInt(columnPos);
}