db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1348520 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java
Date Sun, 10 Jun 2012 00:24:00 GMT
Author: mamta
Date: Sun Jun 10 00:23:59 2012
New Revision: 1348520

URL: http://svn.apache.org/viewvc?rev=1348520&view=rev
Log:
DERBY-5578 Provide a way to invalidate stored prepared statements

Close the resultset in the helper methods as suggested by Knut.


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java?rev=1348520&r1=1348519&r2=1348520&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java
Sun Jun 10 00:23:59 2012
@@ -212,29 +212,38 @@ public class TriggerTest extends BaseJDB
     //Get a count of number of invalid statements in SYS.SYSSTATEMENTS
     private int numberOfInvalidStatementsInSysstatements(Statement st)
     		throws SQLException {
+    	int num;
     	ResultSet rs = st.executeQuery(
     			"SELECT COUNT(*) FROM SYS.SYSSTATEMENTS "+
         		"WHERE VALID = false");
     	rs.next();
-    	return(rs.getInt(1));
+    	num = rs.getInt(1);
+    	rs.close();
+    	return(num);
     }
 
     //Get a count of number of valid statements in SYS.SYSSTATEMENTS
     private int numberOfValidStatementsInSysstatements(Statement st)
     		throws SQLException {
+    	int num;
     	ResultSet rs = st.executeQuery(
     			"SELECT COUNT(*) FROM SYS.SYSSTATEMENTS "+
         		"WHERE VALID = TRUE");
     	rs.next();
-    	return(rs.getInt(1));
+    	num = rs.getInt(1);
+    	rs.close();
+    	return(num);
     }
 
     //Get a count of number of rows in SYS.SYSSTATEMENTS
     private int numberOfRowsInSysstatements(Statement st)
     		throws SQLException {
+    	int num;
     	ResultSet rs = st.executeQuery("SELECT COUNT(*) FROM SYS.SYSSTATEMENTS");
     	rs.next();
-    	return(rs.getInt(1));
+    	num = rs.getInt(1);
+    	rs.close();
+    	return(num);
     }
     
     /**



Mime
View raw message