You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2010/08/10 21:32:52 UTC

svn commit: r984177 - /db/torque/village/trunk/src/java/com/workingdogs/village/QueryDataSet.java

Author: tfischer
Date: Tue Aug 10 19:32:52 2010
New Revision: 984177

URL: http://svn.apache.org/viewvc?rev=984177&view=rev
Log:
TORQUE-123: Change Fix such that it is java 1.4 compatible

Modified:
    db/torque/village/trunk/src/java/com/workingdogs/village/QueryDataSet.java

Modified: db/torque/village/trunk/src/java/com/workingdogs/village/QueryDataSet.java
URL: http://svn.apache.org/viewvc/db/torque/village/trunk/src/java/com/workingdogs/village/QueryDataSet.java?rev=984177&r1=984176&r2=984177&view=diff
==============================================================================
--- db/torque/village/trunk/src/java/com/workingdogs/village/QueryDataSet.java (original)
+++ db/torque/village/trunk/src/java/com/workingdogs/village/QueryDataSet.java Tue Aug 10 19:32:52 2010
@@ -77,37 +77,29 @@ public class QueryDataSet
 
         selectString = new StringBuffer(selectStmt);
         
-        try 
-        { 
-        	stmt = conn.createStatement(); 
-        	resultSet = stmt.executeQuery(selectStmt); 
-        	schema = new Schema(); 
-        	schema.populate(resultSet.getMetaData(), null); 
+        boolean ok = false;
+        try
+        {
+            stmt = conn.createStatement();
+            resultSet = stmt.executeQuery(selectStmt);
+            schema = new Schema();
+            schema.populate(resultSet.getMetaData(), null);
+            ok = true;
         } 
-        catch (Exception e) 
-        { 
-        	try 
-        	{
-        		close();
-        	} 
-        	catch (SQLException ignored)
-        	{
-        		// Do nothing
-        	} 
-
-        	if (e instanceof SQLException)
-        	{
-        		throw (SQLException)e;
-        	}
-        	else if (e instanceof DataSetException)
-        	{
-        		throw (DataSetException)e;
-        	}
-        	else
-        	{
-        		throw new SQLException("QueryDataSet: exception caught.", e);
-        	}
-        }         
+        finally
+        {
+            if (!ok)
+            {
+                try
+                {
+                    close();
+                }
+                catch (Exception ignored)
+                {
+                    // ignore as another exception is already thrown
+                }
+            }
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org