db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r106787 - in incubator/derby/code/trunk/java/engine/org/apache/derby: iapi/reference impl/jdbc loc
Date Sun, 28 Nov 2004 05:02:23 GMT
Author: djd
Date: Sat Nov 27 21:02:21 2004
New Revision: 106787

URL: http://svn.apache.org/viewcvs?view=rev&rev=106787
Log:
Fix for Derby-33 - not implemented exception when passing in empty type map to JBDC calls.

Handling the map conditions the following way

  null Map      --> throw a SQLException
  empty Map     --> no-op
  non-empty Map --> throw notImplemented.

Patch contributed by Shreyas Kaushik (Shreyas.Kaushik@Sun.COM)



Modified:
   incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/SQLState.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement20.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection20.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet20.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/SQLState.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/SQLState.java?view=diff&rev=106787&p1=incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/SQLState.java&r1=106786&p2=incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/SQLState.java&r2=106787
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/SQLState.java	(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/SQLState.java	Sat
Nov 27 21:02:21 2004
@@ -1362,6 +1362,7 @@
     String MIDDLE_OF_BATCH = "XJ068.S";
     String NO_SETXXX_FOR_EXEC_USING = "XJ069.S";
     String LANG_NUM_PARAMS_INCORRECT = "XJ080.S";
+    String INVALID_API_PARAMETER = "XJ081.S";
     String INTERNAL_ERROR = "XJ999.S";
     String CONN_GENERIC = "X0RQB.S";
     String CONN_REMOTE_ERROR = "X0RQC.S";

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement20.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement20.java?view=diff&rev=106787&p1=incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement20.java&r1=106786&p2=incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement20.java&r2=106787
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement20.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement20.java
Sat Nov 27 21:02:21 2004
@@ -44,6 +44,7 @@
 import org.apache.derby.iapi.error.StandardException;
 
 import org.apache.derby.iapi.sql.conn.StatementContext;
+import org.apache.derby.iapi.reference.SQLState;
 
 import org.apache.derby.impl.jdbc.Util;
 import org.apache.derby.impl.jdbc.EmbedConnection;
@@ -120,7 +121,13 @@
      */
 	public Object  getObject (int i, java.util.Map map) throws SQLException 
 	{
-		throw Util.notImplemented();
+		if( map == null)
+            throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER,map,"map",
+                                              "java.sql.CallableStatement.getObject");
+        if(!(map.isEmpty()))
+            throw Util.notImplemented();
+        // Map is empty call the normal getObject method.
+        return getObject(i);
 	}
 
     /**
@@ -1108,7 +1115,14 @@
 	public Object getObject(String parameterName, Map map)
     throws SQLException
 	{
-		throw Util.notImplemented();
+		if( map == null)
+            throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER,map,"map",
+                                              "java.sql.CallableStatement.getObject");
+        if(!(map.isEmpty()))
+            throw Util.notImplemented();
+
+        // Map is empty so call the normal getObject method.
+        return getObject(parameterName);
 	}
 
 	/**

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection20.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection20.java?view=diff&rev=106787&p1=incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection20.java&r1=106786&p2=incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection20.java&r2=106787
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection20.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection20.java
Sat Nov 27 21:02:21 2004
@@ -31,6 +31,7 @@
 import org.apache.derby.jdbc.Driver169;
 
 import org.apache.derby.iapi.store.access.XATransactionController;
+import org.apache.derby.iapi.reference.SQLState;
 
 import java.util.Properties;
 
@@ -109,7 +110,12 @@
      * @exception SQLException Feature not implemented for now.
 	 */
     public void setTypeMap(java.util.Map map) throws SQLException {
-		throw Util.notImplemented();
+
+        if( map == null)
+            throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER,map,"map",
+                                              "java.sql.Connection.setTypeMap");
+        if(!(map.isEmpty()))
+            throw Util.notImplemented();
     }
 
 	/*

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet20.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet20.java?view=diff&rev=106787&p1=incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet20.java&r1=106786&p2=incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet20.java&r2=106787
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet20.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet20.java
Sat Nov 27 21:02:21 2004
@@ -1434,7 +1434,13 @@
          * @exception SQLException Feature not implemented for now.
      */
     public Object getObject(int columnIndex, java.util.Map map) throws SQLException {
-                throw Util.notImplemented();
+        if( map == null)
+            throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER,map,"map",
+                                              "java.sql.ResultSet.getObject");
+        if(!(map.isEmpty()))
+            throw Util.notImplemented();
+        // Map is empty call the normal getObject method.
+        return getObject(columnIndex);
         }
 
     /**
@@ -1600,7 +1606,7 @@
      */
     public Object getObject(String colName, java.util.Map map)
     throws SQLException {
-                throw Util.notImplemented();
+        return getObject(findColumn(colName),map);
         }
 
     /**

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties?view=diff&rev=106787&p1=incubator/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties&r1=106786&p2=incubator/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties&r2=106787
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties	(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties	Sat
Nov 27 21:02:21 2004
@@ -1073,6 +1073,7 @@
 XJ068.S=Only executeBatch and clearBatch allowed in the middle of a batch.
 XJ069.S=No SetXXX methods allowed in case of Execute Statement Using.
 XJ080.S=Execute Statement Using passed {0} parameters rather than {1}.
+XJ081.S=Invalid value ''{0}'' passed as parameter ''{1}'' to method ''{2}''
 XJ070.S=Negative or zero position argument ''{0}'' passed in a Blob or Clob method.
 XJ071.S=Zero or negative length argument ''{0}'' passed in a Blob or Clob method.
 XJ072.S=Null pattern or searchStr passed in to a Blob or Clob position method.

Mime
View raw message