You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2011/08/19 08:22:23 UTC
svn commit: r1159514 -
/commons/proper/dbutils/trunk/src/site/xdoc/examples.xml
Author: bayard
Date: Fri Aug 19 06:22:22 2011
New Revision: 1159514
URL: http://svn.apache.org/viewvc?rev=1159514&view=rev
Log:
Splitting the example per DBUTILS-78
Modified:
commons/proper/dbutils/trunk/src/site/xdoc/examples.xml
Modified: commons/proper/dbutils/trunk/src/site/xdoc/examples.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/site/xdoc/examples.xml?rev=1159514&r1=1159513&r2=1159514&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/site/xdoc/examples.xml (original)
+++ commons/proper/dbutils/trunk/src/site/xdoc/examples.xml Fri Aug 19 06:22:22 2011
@@ -146,14 +146,18 @@ try
// Create a Callable for the update call
Callable<Integer> callable = asyncRun.update( "UPDATE Person SET height=? WHERE name=?",
2.05, "John Doe" );
-
// Submit the Callable to the executor
executor.submit( callable );
+} catch(SQLException sqle) {
+ // Handle it
+}
- // Later (or in another thread) get the result
+// Sometime later (or in another thread)
+try
+{
+ // Get the result of the update
Integer updates = executor.take().get();
-}
-catch(SQLException sqle) {
+} catch(InterruptedException ie) {
// Handle it
}
]]>