// Use a ResultSetHandler implementation, ArrayHandler, to convert the | |
// first row into an Object[]. | |
ResultSetHandler<Object[]> handler = new ArrayHandler(); | |
// Create a QueryRunner that will use connections from | |
// the given DataSource | |
QueryRunner runner = new QueryRunner(dataSource); | |
// Generate a QueryExecutor for the query | |
QueryExecutor executor = runner.query("SELECT * FROM Person WHERE first_name=:first_name and last_name = :last_name"); | |
// Bind our parameters and execute the query | |
Object[] result = executor.bind("first_name", "John") | |
.bind("last_name", "Doe") | |
.execute(handler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment