Skip to content

Instantly share code, notes, and snippets.

@wspeirs
Created January 8, 2014 22:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save wspeirs/8326023 to your computer and use it in GitHub Desktop.
QueryRunner runner = new QueryRunner(dataSource);
// Use the BeanListHandler implementation to convert all
// ResultSet rows into a List of Person JavaBeans.
ResultSetHandler<List<Person>> handler = new BeanListHandler<Person>(Person.class);
// Execute the SQL statement and return the results in a List of
// Person objects generated by the BeanListHandler.
List<Person> persons = runner.query("SELECT * FROM Person").execute(handler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment