ResultSetHandler < Object []> h = ... // Define a handler the same as above example
// No DataSource so we must handle Connections manually
QueryRunner run = new QueryRunner ();
Connection conn = ... // open a connection
try {
Object [] result = run . query (
conn , "SELECT * FROM Person WHERE name=?" , h , "John Doe" );
// do something with the result
} finally {
// Use this helper method so we don't have to check for null
DbUtils . close ( conn );
}