db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r984177 - /db/torque/village/trunk/src/java/com/workingdogs/village/QueryDataSet.java
Date Tue, 10 Aug 2010 19:32:52 GMT
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


Mime
View raw message