db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r412204 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ client/org/apache/derby/client/net/ engine/org/apache/derby/iapi/jdbc/ engine/org/apache/derby/impl/jdbc/ testing/org/apache/derbyTesting/functionTests/master/ testi...
Date Tue, 06 Jun 2006 20:29:06 GMT
Author: rhillegas
Date: Tue Jun  6 13:29:05 2006
New Revision: 412204

URL: http://svn.apache.org/viewvc?rev=412204&view=rev
Log:
DERBY-1380: Commit Dyre's derby-1380,v1.diff patch, which makes it possible to connect to
Derby databases when running under build 86 of jdk1.6.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/FailedProperties40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/FailedProperties40.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TestDbMetaData.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/TestDbMetaData.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/FailedProperties40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/FailedProperties40.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/FailedProperties40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/FailedProperties40.java Tue
Jun  6 13:29:05 2006
@@ -22,21 +22,40 @@
 
 import java.util.Properties;
 import java.util.Enumeration;
-import java.sql.ClientInfoException;
+import java.util.Map;
+import java.util.HashMap;
+import java.sql.SQLClientInfoException;
+import java.sql.ClientInfoStatus;
 
     /**
      * Class <code>FailedProperties40</code> is a helper class for
-     * <code>java.sql.ClientInfoException</code>. It provides
+     * <code>java.sql.SQLClientInfoException</code>. It provides
      * convenient access to data that is needed when constructing
      * those exceptions. Should be kept in sync with its embedded
      * counter part.
-     * @see java.sql.ClientInfoException
+     * @see java.sql.SQLClientInfoException
      * @see org.apache.derby.iapi.jdbc.FailedProperties40
      */
 public class FailedProperties40 {
-    private final Properties failedProps_ = new Properties();
+    private final HashMap<String,ClientInfoStatus> failedProps_ = 
+	new HashMap<String,ClientInfoStatus>();
+
     private final String firstKey_;
     private final String firstValue_;
+
+    /**
+     * Helper method that creates a Propery object with the name-value
+     * pair given as arguments.
+     * @param name property key
+     * @param value property value
+     * @return the created <code>Properties</code> object
+     */
+    public static Properties makeProperties(String name, String value) {
+	Properties p = new Properties();
+        if (name != null || value != null)
+            p.setProperty(name, value);
+	return p;
+    }
     
     /**
      * Creates a new <code>FailedProperties40</code> instance. Since
@@ -56,28 +75,27 @@
         Enumeration e = props.keys();
         firstKey_ = (String)e.nextElement();
         firstValue_ = props.getProperty(firstKey_);
-        failedProps_.setProperty(firstKey_, ""+ClientInfoException.
-                                 REASON_UNKNOWN_PROPERTY);
+        failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
         while (e.hasMoreElements()) {
-            failedProps_.setProperty((String)e.nextElement(), 
-                                     ""+ClientInfoException.
-                                     REASON_UNKNOWN_PROPERTY);
+            failedProps_.put((String)e.nextElement(), 
+                             ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
         }
     }
 
     /**
-     * <code>getProperties</code> provides a <code>Properties</code>
-     * object describing the failed properties (as specified in the
-     * javadoc for java.sql.ClientInfoException).
+     * <code>getProperties</code> provides a
+     * <code>Map<String,ClientInfoStatus></code> object describing the
+     * failed properties (as specified in the javadoc for
+     * java.sql.SQLClientInfoException).
      *
-     * @return a <code>Properties</code> object with the failed
-     * property keys and the reason why each failed
+     * @return a <code>Map<String,ClientInfoStatus></code> object with
+     * the failed property keys and the reason why each failed
      */
-    public Properties getProperties() { return failedProps_; }
+    public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }
 
     /**
      * <code>getFirstKey</code> returns the first property key. Used
-     * when ClientInfoException is thrown with a parameterized error
+     * when SQLClientInfoException is thrown with a parameterized error
      * message.
      *
      * @return a <code>String</code> value
@@ -86,7 +104,7 @@
 
     /**
      * <code>getFirstValue</code> returns the first property value. Used
-     * when ClientInfoException is thrown with a parameterized error
+     * when SQLClientInfoException is thrown with a parameterized error
      * message.
      *
      * @return a <code>String</code> value

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection40.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection40.java Tue
Jun  6 13:29:05 2006
@@ -23,7 +23,7 @@
 import java.sql.Array;
 import java.sql.BaseQuery;
 import java.sql.Blob;
-import java.sql.ClientInfoException;
+import java.sql.SQLClientInfoException;
 import java.sql.Clob;
 import java.sql.NClob;
 import java.sql.SQLXML;
@@ -52,10 +52,10 @@
         super(physicalConnection, pooledConnection);
     }
 
-    public Array createArray(String typeName, Object[] elements)
+    public Array createArrayOf(String typeName, Object[] elements)
         throws SQLException {
 		checkForNullPhysicalConnection();
-        return physicalConnection_.createArray( typeName, elements );
+        return physicalConnection_.createArrayOf( typeName, elements );
     }
     
     public Blob createBlob()
@@ -172,13 +172,13 @@
      *
      * @param properties a <code>Properties</code> object with the
      * properties to set
-     * @exception ClientInfoException if an error occurs
+     * @exception SQLClientInfoException if an error occurs
      */
     public void setClientInfo(Properties properties)
-        throws ClientInfoException {
+        throws SQLClientInfoException {
 	try { checkForNullPhysicalConnection(); }
 	catch (SQLException se) { 
-	    throw new ClientInfoException
+	    throw new SQLClientInfoException
 		(se.getMessage(), se.getSQLState(), 
 		 (new FailedProperties40(properties)).getProperties());
 	}
@@ -194,8 +194,15 @@
      * @exception SQLException if an error occurs
      */
     public void setClientInfo(String name, String value)
-        throws SQLException {
-	checkForNullPhysicalConnection();
+        throws SQLClientInfoException {
+	try { checkForNullPhysicalConnection(); }
+        catch (SQLException se) {
+            throw new SQLClientInfoException
+                (se.getMessage(), se.getSQLState(),
+                 new FailedProperties40
+                 (FailedProperties40.makeProperties
+                  (name,value)).getProperties());
+        }
 	physicalConnection_.setClientInfo(name, value);
     }
     

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java Tue Jun
 6 13:29:05 2006
@@ -26,7 +26,7 @@
 import org.apache.derby.client.am.SQLExceptionFactory;
 import org.apache.derby.client.am.SqlException;
 import java.sql.Blob;
-import java.sql.ClientInfoException;
+import java.sql.SQLClientInfoException;
 import java.sql.Clob;
 import java.sql.NClob;
 import java.sql.PreparedStatement;
@@ -128,9 +128,9 @@
     
 
     
-    public Array createArray(String typeName, Object[] elements)
+    public Array createArrayOf(String typeName, Object[] elements)
         throws SQLException {
-        throw SQLExceptionFactory.notImplemented ("createArray(String,Object[])");
+        throw SQLExceptionFactory.notImplemented ("createArrayOf(String,Object[])");
     }
 
     /**
@@ -268,7 +268,7 @@
 
     /**
      * <code>setClientInfo</code> will always throw a
-     * <code>ClientInfoException</code> since Derby does not support
+     * <code>SQLClientInfoException</code> since Derby does not support
      * any properties.
      *
      * @param name a property key <code>String</code>
@@ -276,21 +276,24 @@
      * @exception SQLException always.
      */
     public void setClientInfo(String name, String value)
-    throws SQLException{
+    throws SQLClientInfoException{
+        Properties p = FailedProperties40.makeProperties(name,value); 
 	try { checkForClosedConnection(); }
-	catch (SqlException se) { throw se.getSQLException(); }
+	catch (SqlException se) {
+            throw new SQLClientInfoException
+                (se.getMessage(), se.getSQLState(), 
+                 new FailedProperties40(p).getProperties());
+        }
 
         if (name == null && value == null) {
             return;
         }
-        Properties p = new Properties();
-        p.setProperty(name, value);
         setClientInfo(p);
     }
 
     /**
      * <code>setClientInfo</code> will throw a
-     * <code>ClientInfoException</code> uless the <code>properties</code>
+     * <code>SQLClientInfoException</code> uless the <code>properties</code>
      * paramenter is empty, since Derby does not support any
      * properties. All the property keys in the
      * <code>properties</code> parameter are added to failedProperties
@@ -299,14 +302,15 @@
      *
      * @param properties a <code>Properties</code> object with the
      * properties to set.
-     * @exception ClientInfoException always.
+     * @exception SQLClientInfoException unless the properties
+     * parameter is null or empty.
      */
     public void setClientInfo(Properties properties)
-    throws ClientInfoException {
+    throws SQLClientInfoException {
 	FailedProperties40 fp = new FailedProperties40(properties);
 	try { checkForClosedConnection(); } 
 	catch (SqlException se) {
-	    throw new ClientInfoException(se.getMessage(), se.getSQLState(),
+	    throw new SQLClientInfoException(se.getMessage(), se.getSQLState(),
 					  fp.getProperties());
 	}
 	
@@ -319,8 +323,8 @@
 			     new ClientMessageId
 			     (SQLState.PROPERTY_UNSUPPORTED_CHANGE), 
 			     fp.getFirstKey(), fp.getFirstValue());
-        throw new ClientInfoException(se.getMessage(),
-				      se.getSQLState(), fp.getProperties());
+        throw new SQLClientInfoException(se.getMessage(),
+                                         se.getSQLState(), fp.getProperties());
     }
 
     /**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java Tue
Jun  6 13:29:05 2006
@@ -24,7 +24,7 @@
 import java.sql.BaseQuery;
 import java.sql.Blob;
 import java.sql.Clob;
-import java.sql.ClientInfoException;
+import java.sql.SQLClientInfoException;
 import java.sql.NClob;
 import java.sql.SQLException;
 import java.sql.SQLXML;
@@ -42,10 +42,10 @@
         super(control);
     }
     
-    public Array createArray(String typeName, Object[] elements)
+    public Array createArrayOf(String typeName, Object[] elements)
           throws SQLException {    
          try {
-             return getRealConnection().createArray (typeName, elements);
+             return getRealConnection().createArrayOf (typeName, elements);
          } catch (SQLException sqle) {
              notifyException(sqle);
              throw sqle;
@@ -169,40 +169,47 @@
      *
      * @param name the property key <code>String</code>
      * @param value the property value <code>String</code>
-     * @exception SQLException if the property is not supported or the 
-     * real connection could not be obtained.
+     * @exception SQLClientInfoException if the property is not
+     * supported or the real connection could not be obtained.
      */
     public void setClientInfo(String name, String value)
-    throws SQLException{        
+    throws SQLClientInfoException{        
         try {
             getRealConnection().setClientInfo(name, value);
-        } catch (SQLException se) {
+        } catch (SQLClientInfoException se) {
             notifyException(se);
             throw se;
         }
+        catch (SQLException se) {
+            throw new SQLClientInfoException
+                (se.getMessage(), se.getSQLState(), 
+  		 (new FailedProperties40
+		  (FailedProperties40.makeProperties(name,value))).
+		 getProperties());
+        }
     }
 
     /**
      * <code>setClientInfo</code> forwards to the real connection.  If
      * the call to <code>getRealConnection</code> fails the resulting
      * <code>SQLException</code> is wrapped in a
-     * <code>ClientInfoException</code> to satisfy the specified
+     * <code>SQLClientInfoException</code> to satisfy the specified
      * signature.
      * @param properties a <code>Properties</code> object with the
      * properties to set.
-     * @exception ClientInfoException if the properties are not
+     * @exception SQLClientInfoException if the properties are not
      * supported or the real connection could not be obtained.
      */    
     public void setClientInfo(Properties properties)
-    throws ClientInfoException{
+    throws SQLClientInfoException{
         try {
             getRealConnection().setClientInfo(properties);
-        } catch (ClientInfoException cie) {
+        } catch (SQLClientInfoException cie) {
             notifyException(cie);
             throw cie;
         }
         catch (SQLException se) {
-            throw new ClientInfoException
+            throw new SQLClientInfoException
                 (se.getMessage(), se.getSQLState(), 
   		 (new FailedProperties40(properties)).getProperties());
         }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/FailedProperties40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/FailedProperties40.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/FailedProperties40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/FailedProperties40.java Tue
Jun  6 13:29:05 2006
@@ -22,21 +22,39 @@
 
 import java.util.Properties;
 import java.util.Enumeration;
-import java.sql.ClientInfoException;
+import java.util.Map;
+import java.util.HashMap;
+import java.sql.SQLClientInfoException;
+import java.sql.ClientInfoStatus;
 
     /**
      * Class <code>FailedProperties40</code> is a helper class for the
-     * ClientInfoException. It provides convenient access to data
-     * that is needed when constructing ClientInfoExceptions. Should
+     * SQLClientInfoException. It provides convenient access to data
+     * that is needed when constructing SQLClientInfoExceptions. Should
      * be kept in sync with its client side counter part
      * (org.apache.derby.client.am.FailedProperties40).
+     * @see java.sql.SQLClientInfoException
      * @see org.apache.derby.client.am.FailedProperties40
      */
 public class FailedProperties40 {
-    private final Properties failedProps_ = new Properties();
+    private final HashMap<String,ClientInfoStatus> failedProps_ = 
+	new HashMap<String,ClientInfoStatus>();
     private final String firstKey_;
     private final String firstValue_;
-    
+
+    /**
+     * Helper method that creates a Propery object from the name-value
+     * pair given as arguments.
+     * @param name property key
+     * @param value property value
+     * @return the created <code>Properties</code> object
+     */
+    public static Properties makeProperties(String name, String value) {
+	Properties p = new Properties();
+	if (name != null || value != null)
+	    p.setProperty(name, value);
+	return p;
+    }
     /**
      * Creates a new <code>FailedProperties40</code> instance. Since
      * Derby doesn't support any properties, all the keys from the
@@ -55,28 +73,27 @@
         Enumeration e = props.keys();
         firstKey_ = (String)e.nextElement();
         firstValue_ = props.getProperty(firstKey_);
-        failedProps_.setProperty(firstKey_, ""+ClientInfoException.
-                                 REASON_UNKNOWN_PROPERTY);
+        failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
         while (e.hasMoreElements()) {
-            failedProps_.setProperty((String)e.nextElement(), 
-                                     ""+ClientInfoException.
-                                     REASON_UNKNOWN_PROPERTY);
+            failedProps_.put((String)e.nextElement(), 
+			     ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
         }
     }
 
     /**
-     * <code>getProperties</code> provides a <code>Properties</code>
-     * object describing the failed properties (as specified in the
-     * javadoc for java.sql.ClientInfoException).
+     * <code>getProperties</code> provides a
+     * <code>Map<String,ClientInfoStatus></code> object describing the
+     * failed properties (as specified in the javadoc for
+     * java.sql.SQLClientInfoException).
      *
-     * @return a <code>Properties</code> object with the failed
-     * property keys and the reason why each failed
+     * @return a <code>Map<String,ClientInfoStatus></code> object with
+     * the failed property keys and the reason why each failed
      */
-    public Properties getProperties() { return failedProps_; }
+    public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }
 
     /**
      * <code>getFirstKey</code> returns the first property key. Used
-     * when ClientInfoException is thrown with a parameterized error
+     * when SQLClientInfoException is thrown with a parameterized error
      * message.
      *
      * @return a <code>String</code> value
@@ -85,7 +102,7 @@
 
     /**
      * <code>getFirstValue</code> returns the first property value. Used
-     * when ClientInfoException is thrown with a parameterized error
+     * when SQLClientInfoException is thrown with a parameterized error
      * message.
      *
      * @return a <code>String</code> value

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java Tue
Jun  6 13:29:05 2006
@@ -23,7 +23,7 @@
 import java.sql.Array;
 import java.sql.BaseQuery;
 import java.sql.Blob;
-import java.sql.ClientInfoException;
+import java.sql.SQLClientInfoException;
 import java.sql.Clob;
 import java.sql.NClob;
 import java.sql.QueryObjectFactory;
@@ -60,7 +60,7 @@
      *-------------------------------------------------------
      */
     
-    public Array createArray(String typeName, Object[] elements)
+    public Array createArrayOf(String typeName, Object[] elements)
         throws SQLException {
         throw Util.notImplemented();
     }
@@ -141,30 +141,35 @@
 
     /**
      * <code>setClientInfo</code> will always throw a
-     * <code>ClientInfoException</code> since Derby does not support
+     * <code>SQLClientInfoException</code> since Derby does not support
      * any properties.
      *
      * @param name a property key <code>String</code>
      * @param value a property value <code>String</code>
-     * @exception SQLException always.
+     * @exception SQLClientInfoException unless both name and value are null
      */
     public void setClientInfo(String name, String value)
-    throws SQLException{
-        checkIfClosed();
+    throws SQLClientInfoException{
+        Properties p = FailedProperties40.makeProperties(name,value);
+        try { checkIfClosed(); }
+        catch (SQLException se) {
+            FailedProperties40 fp = new FailedProperties40(p);
+            throw new SQLClientInfoException(se.getMessage(), 
+                                             se.getSQLState(), 
+                                             fp.getProperties());
+        }
         // Allow null to simplify compliance testing through
         // reflection, (test all methods in an interface with null
         // arguments)
         if (name == null && value == null) {
             return;
         }
-        Properties p = new Properties();
-        p.setProperty(name, value);
         setClientInfo(p);
     }
     
     /**
      * <code>setClientInfo</code> will throw a
-     * <code>ClientInfoException</code> uless the <code>properties</code>
+     * <code>SQLClientInfoException</code> uless the <code>properties</code>
      * paramenter is empty, since Derby does not support any
      * properties. All the property keys in the
      * <code>properties</code> parameter are added to failedProperties
@@ -173,16 +178,17 @@
      *
      * @param properties a <code>Properties</code> object with the
      * properties to set
-     * @exception ClientInfoException always
+     * @exception SQLClientInfoException unless properties parameter
+     * is null or empty
      */
     public void setClientInfo(Properties properties)
-    throws ClientInfoException {
+    throws SQLClientInfoException {
         FailedProperties40 fp = new FailedProperties40(properties);
         
         try { checkIfClosed(); }
         catch (SQLException se) {
-            throw new ClientInfoException(se.getMessage(), se.getSQLState(),
-                                          fp.getProperties());
+            throw new SQLClientInfoException(se.getMessage(), se.getSQLState(),
+                                             fp.getProperties());
         }
 
         // Allow null to simplify compliance testing through
@@ -198,8 +204,8 @@
             (SQLState.PROPERTY_UNSUPPORTED_CHANGE, 
              fp.getFirstKey(), 
              fp.getFirstValue());
-        throw new ClientInfoException(se.getMessage(),
-                                      se.getSQLState(), fp.getProperties());
+        throw new SQLClientInfoException(se.getMessage(),
+                                         se.getSQLState(), fp.getProperties());
     }
     
     /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TestDbMetaData.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TestDbMetaData.out?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TestDbMetaData.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TestDbMetaData.out
Tue Jun  6 13:29:05 2006
@@ -6,6 +6,7 @@
 true
 true
 true
+true
 FUNCTION_CAT,FUNCTION_SCHEM,FUNCTION_NAME,REMARKS,SPECIFIC_NAME
 null,APP,DUMMY1,java.some.func,xxxxGENERATED-IDxxxx
 null,APP,DUMMY2,java.some.func,xxxxGENERATED-IDxxxx

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java
Tue Jun  6 13:29:05 2006
@@ -23,7 +23,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.sql.CallableStatement;
-import java.sql.ClientInfoException;
+import java.sql.SQLClientInfoException;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
@@ -614,7 +614,7 @@
         /**
          * Checks that the exception has an expected SQL state (08003
          * - no current connection). Also accept
-         * <code>ClientInfoException</code>s from
+         * <code>SQLClientInfoException</code>s from
          * <code>setClientInfo()</code>.
          *
          * @param method a <code>Method</code> value
@@ -624,7 +624,7 @@
         protected void checkSQLState(Method method, SQLException sqle)
             throws SQLException
         {
-            if (sqle instanceof ClientInfoException &&
+            if (sqle instanceof SQLClientInfoException &&
                 method.getName().equals("setClientInfo") &&
                 Arrays.asList(method.getParameterTypes())
                 .equals(Arrays.asList(new Class[] { Properties.class }))) {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java
Tue Jun  6 13:29:05 2006
@@ -124,8 +124,8 @@
     public void testCreateArrayNotImplemented()
         throws SQLException {
         try {
-            con.createArray(null, null);
-            fail("createArray(String,Object[]) should not be implemented");
+            con.createArrayOf(null, null);
+            fail("createArrayOf(String,Object[]) should not be implemented");
         } catch (SQLFeatureNotSupportedException sfnse) {
             // Do nothing, we are fine
         }
@@ -240,19 +240,19 @@
         try {
             con.setClientInfo(p);
             fail("setClientInfo(String,String) should throw "+
-                 "ClientInfoException");
-        } catch (ClientInfoException cie) {
+                 "SQLClientInfoException");
+        } catch (SQLClientInfoException cie) {
             assertSQLState("SQLStates must match", "XCY02", cie);
             assertTrue("Setting property 'prop1' must fail with "+
                        "REASON_UNKNOWN_PROPERTY",
                        cie.getFailedProperties().
-                       getProperty("prop1").
-                       equals(""+ClientInfoException.REASON_UNKNOWN_PROPERTY));
-            assertTrue("Setting property 'prop2' must fail with "+
-                       "REASON_UNKNOWN_PROPERTY",
-                       cie.getFailedProperties().
-                       getProperty("prop2").
-                       equals(""+ClientInfoException.REASON_UNKNOWN_PROPERTY));
+                       get("prop1").
+                       equals(ClientInfoStatus.REASON_UNKNOWN_PROPERTY));
+             assertTrue("Setting property 'prop2' must fail with "+
+                        "REASON_UNKNOWN_PROPERTY",
+                        cie.getFailedProperties().
+                        get("prop2").
+                        equals(ClientInfoStatus.REASON_UNKNOWN_PROPERTY));
         }
     }
 
@@ -269,15 +269,15 @@
         try {
             con.setClientInfo("name", "value");
             fail("setClientInfo(String,String) should throw "+
-                 "ClientInfoException");
-        } catch (ClientInfoException cie) {
+                 "SQLClientInfoException");
+        } catch (SQLClientInfoException cie) {
             assertSQLState("SQLState must match 'unsupported'",
                            "XCY02", cie);
             assertTrue("Setting property 'name' must fail with "+
                        "REASON_UNKNOWN_PROPERTY",
                        cie.getFailedProperties().
-                       getProperty("name").
-                       equals(""+ClientInfoException.REASON_UNKNOWN_PROPERTY));
+                       get("name").
+                       equals(ClientInfoStatus.REASON_UNKNOWN_PROPERTY));
         }
     }
     

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/TestDbMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/TestDbMetaData.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/TestDbMetaData.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/TestDbMetaData.java
Tue Jun  6 13:29:05 2006
@@ -94,10 +94,8 @@
         checkEmptyRS(met.getClientInfoProperties());
 
 		// Make sure the constants provided in JDBC40Translation is correct
-
-		// Uncomment this when jdk16 contains functionParameterUnknown
-//  		System.out.println(""+(JDBC40Translation.FUNCTION_PARAMETER_UNKNOWN == 
-// 							   DatabaseMetaData.functionParameterUnknown));
+  		System.out.println(""+(JDBC40Translation.FUNCTION_PARAMETER_UNKNOWN == 
+ 							   DatabaseMetaData.functionParameterUnknown));
 		System.out.println(""+(JDBC40Translation.FUNCTION_PARAMETER_IN == 
 							   DatabaseMetaData.functionParameterIn));
 		System.out.println(""+(JDBC40Translation.FUNCTION_PARAMETER_INOUT == 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=412204&r1=412203&r2=412204&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
Tue Jun  6 13:29:05 2006
@@ -71,7 +71,7 @@
 				java.sql.Connection.class,
 				new MD[]
 				{
-						new MD( "createArray", new Class[] { String.class, Object[].class } ),
+						new MD( "createArrayOf", new Class[] { String.class, Object[].class } ),
 						new MD( "createNClob", new Class[] { } ),
 						new MD( "createSQLXML", new Class[] { } ),
 						new MD( "createStruct", new Class[] { String.class, Object[].class } ),



Mime
View raw message