The DBUtil library from Apache provides a set of class for doing a variety of standard database tasks.
eg. To make a query becomes as simple as the following, providing the result set as a List of arrays where each list elements contains a row.
QueryRunner runner = new QueryRunner(); ArrayListHandler handler = new ArrayListHandler(); List<Object> result = runner.query(connection, "SELECT * FROM MyTable WHERE name=?", handler, "Joe Smith"); DbUtils.close(conn);