Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AsyncExecutor asyncRun = new AsyncExecutor(Executors.newFixedThreadPool(5));
try
{
// Setup the UpdateExecutor
UpdateExecutor executor = runner.update("UPDATE Person SET height=:height WHERE name=:name")
.bind(":height", 2.05)
.bind("name", "John Doe");
// Returns a Future for the update call
Future<Integer> callable = asyncRun.execute(executor);
} catch(SQLException sqle) {
// Handle it
}
// Sometime later (or in another thread)
try
{
// Get the result of the update
Integer updates = callable.get();
} catch(InterruptedException ie) {
// Handle it
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.