Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
QueryRunner runner = new QueryRunner(dataSource);
// Execute the SQL insert statement
runner.insert("INSERT INTO Person (name,height) VALUES (:name,:height)")
.bind("name", "John Doe")
.bind("height", 1.82)
// Now it's time to rise to the occation...
int updates = runner.update("UPDATE Person SET height=:height WHERE name=:name")
.bind("name", "John Doe")
.bind("height", 2.05)
catch(SQLException sqle) {
// Handle it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment