db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r614298 - /db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangProcedureTest.java
Date Tue, 22 Jan 2008 19:46:08 GMT
Author: mamta
Date: Tue Jan 22 11:46:05 2008
New Revision: 614298

URL: http://svn.apache.org/viewvc?rev=614298&view=rev
Log:
Migrating revision 614292 from trunk into 10.3 codeline. This just adds a junit test case
for DERBY-3304. The commit comments for 614292 were as follows

Adding a junit test for the standalone test case provided by Dag for DERBY-3304. Here, we
are adding a Java procedure which does a commit and then returns a resultset back to the
caller. The resultset should not get closed as part of the commit.


Modified:
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangProcedureTest.java

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangProcedureTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangProcedureTest.java?rev=614298&r1=614297&r2=614298&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangProcedureTest.java
(original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangProcedureTest.java
Tue Jan 22 11:46:05 2008
@@ -260,7 +260,35 @@
                 "CALL APP.SIGNATURE_BUG_DERBY_258_I(4)");
         s.execute("DROP PROCEDURE SIGNATURE_BUG_DERBY_258_I");
 
+        s.execute("CREATE PROCEDURE DERBY_3304() "
+                + " DYNAMIC RESULT SETS 1 LANGUAGE JAVA PARAMETER STYLE JAVA " 
+                + " EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.LangProcedureTest.DERBY_3304'"
+                + " MODIFIES SQL DATA");               
+        String[][] t1Results = { { "APP"} };
+        ResultSet rs = s.executeQuery("CALL APP.DERBY_3304()");
+        JDBC.assertFullResultSet(rs, t1Results);
+        s.execute("DROP PROCEDURE DERBY_3304");
+
         s.close();
+    }
+
+    /**
+     * This procedure does an explicit commit and then creates a resultset
+     * to be passed back to the caller. As part of commit, we should not
+     * close the resultset that will be returned by this procedure.
+     * 
+     * @param rs1
+     * @throws SQLException
+     */
+    public static void DERBY_3304(ResultSet[] rs1) throws SQLException 
+    {
+        Connection conn = null;
+        Statement stm = null;
+        conn = DriverManager.getConnection("jdbc:default:connection");
+        stm = conn.createStatement();
+        conn.commit();
+        ResultSet rs = stm.executeQuery("values current_user");
+        rs1[0] = rs;
     }
 
     /**



Mime
View raw message