db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1086559 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMetaDataJdbc30Test.java
Date Tue, 29 Mar 2011 12:04:14 GMT
Author: kahatlen
Date: Tue Mar 29 12:04:14 2011
New Revision: 1086559

URL: http://svn.apache.org/viewvc?rev=1086559&view=rev
Log:
DERBY-5159: ParameterMetaDataJdbc30Test fails with "'PMDD' is not recognized as a function
or procedure"

Create shared procedure in the decorator so that the test cases
that need it can find it regardless of the order of execution.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMetaDataJdbc30Test.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMetaDataJdbc30Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMetaDataJdbc30Test.java?rev=1086559&r1=1086558&r2=1086559&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMetaDataJdbc30Test.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMetaDataJdbc30Test.java
Tue Mar 29 12:04:14 2011
@@ -99,6 +99,17 @@ public class ParameterMetaDataJdbc30Test
             		
 				Connection conn = getConnection();
 
+                // Create procedure used by
+                // testParameterMetadataWithDECIMALParameters() and
+                // testParameterMetadataWithLITERALParameters().
+                stmt.execute(
+                    "CREATE PROCEDURE PMDD(IN pmdI_1 DECIMAL(5,3), " +
+                    "IN pmdI_2 DECIMAL(4,2), INOUT pmdI_3 DECIMAL(9,0), " +
+                    "OUT pmdI_4 DECIMAL(10,2)) language java " +
+                    "parameter style java external name " +
+                    "'org.apache.derbyTesting.functionTests.tests.jdbcapi." +
+                    "ParameterMetaDataJdbc30Test.dummyDecimal'");
+
 				/**
 		                 * Creates the table used in the test cases.
                			 *
@@ -703,8 +714,6 @@ public class ParameterMetaDataJdbc30Test
          */
 	public void testParameterMetadataWithDECIMALParameters () throws SQLException {
 
-		Statement stmt = createStatement();
-       		stmt.execute("CREATE PROCEDURE PMDD(IN pmdI_1 DECIMAL(5,3), IN pmdI_2 DECIMAL(4,2),
INOUT pmdI_3 DECIMAL(9,0), OUT pmdI_4 DECIMAL(10,2)) language java parameter style java external
name 'org.apache.derbyTesting.functionTests.tests.jdbcapi.ParameterMetaDataJdbc30Test.dummyDecimal'");
       		CallableStatement cs = prepareCall("CALL PMDD(?, ?, ?, ?)");
 
 		// parameters 1 and 2 are input only
@@ -739,7 +748,6 @@ public class ParameterMetaDataJdbc30Test
          */
 	public void testParameterMetadataWithLITERALParameters () throws SQLException {
 
-		Statement stmt = createStatement();
       		CallableStatement cs = prepareCall("CALL PMDD(32.4, ?, ?, ?)");
 		// parameters 2 is input only
                 cs.setBigDecimal(1,new BigDecimal("1"));;
@@ -809,8 +817,6 @@ public class ParameterMetaDataJdbc30Test
                 testParameterMetaData(cs.getParameterMetaData(), parameterMetaDataArray2);
 
           	cs.close();
-          	stmt.execute("DROP PROCEDURE PMDD");
-            stmt.close();
 	}
 	/**
          * print the parameter isNullable value in human readable form



Mime
View raw message