db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
Subject svn commit: r392304 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/CallableStatement.java testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java
Date Fri, 07 Apr 2006 14:32:49 GMT
Author: bpendleton
Date: Fri Apr  7 07:32:48 2006
New Revision: 392304

URL: http://svn.apache.org/viewcvs?rev=392304&view=rev
Log:
DERBY-1184: registerOutParameter(int,int,String) should throw exception

Patch contributed by Kristian Waagan (Kristian.Waagan@Sun.com)

The method 'CallableStatement.registerOutParameter(int,int,String)'
does nothing in the client driver. As stated in DERBY-447, the method throws
a not-implemented exception in the embedded driver. The method should be
changed to do this on the client side as well.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java?rev=392304&r1=392303&r2=392304&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java Fri
Apr  7 07:32:48 2006
@@ -264,19 +264,10 @@
     }
 
     public void registerOutParameter(int parameterIndex, int jdbcType, String typeName) throws
SQLException {
-        try
-        {
-            synchronized (connection_) {
-                if (agent_.loggingEnabled()) {
-                    agent_.logWriter_.traceEntry(this, "registerOutParameter", parameterIndex,
jdbcType, typeName);
-                }
-                super.checkForClosedStatement();
-            }
-        }
-        catch ( SqlException se )
-        {
-            throw se.getSQLException();
+        if (agent_.loggingEnabled()) {
+            agent_.logWriter_.traceEntry(this, "registerOutParameter", parameterIndex, jdbcType,
typeName);
         }
+        throw jdbcMethodNotImplemented();
     }
 
     public boolean wasNull() throws SQLException {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java?rev=392304&r1=392303&r2=392304&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/callable.java
Fri Apr  7 07:32:48 2006
@@ -109,6 +109,30 @@
 			cs.close();
 			// stmt.execute("DROP FUNCTION method4");
 
+			// DERBY-1184: User-defined output parameter not supported:
+			if (!TestUtil.isJCCFramework())
+			{
+				cs = conn.prepareCall("? = call method4()");
+				try
+				{
+					cs.registerOutParameter (1, java.sql.Types.INTEGER,
+							"user-def");
+					System.out.println("DERBY-1184 FAIL: Expected exception");
+				}
+				catch (SQLException expectedException)
+				{
+					if (! "0AX01".equals(expectedException.getSQLState()))
+					{
+						System.out.println("DERBY-1184: Caught UNexpected: " +
+							expectedException.getMessage());
+						System.out.println("DERBY-1184: SQLState: " +
+							expectedException.getSQLState() + ", errorCode: " +
+							expectedException.getErrorCode());
+					}
+				}
+				cs.close();
+			}
+
 			// different parameter types, also method overload
 			stmt.execute("CREATE PROCEDURE method4P(" +
 					"IN P1 SMALLINT, IN P2 INT, IN P3 BIGINT, IN P4 REAL, " +



Mime
View raw message