Ferris SQL is a project containing reusable database access components plus classes which enhance or extend the capabilities of the objects already in java.sql.*.
QueryRunner
QueryRunner is exactly like the Jakarta Commons DBUtil project only this code uses generics.
This example sets the parameters by passing them to the query() method.
QueryRunner<JUnitData> run = new QueryRunner<JUnitData>(db.getDataSource()); List<JUnitData> list = run.query( "select * from junit where aVarchar=? and aInteger=?" , new JUnitDataResultSetHandler() , "jfjfjfjfjf" , 100 );
This example sets the parameters by passing them to the addParameter() method.
QueryRunner<JUnitData> run = new QueryRunner<JUnitData>(db.getDataSource()); run.addParameter("michael"); List<JUnitData> list = run.query( "select * from junit where avarchar=?" , new JUnitDataResultSetHandler() );