db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1068073 - in /db/derby/code/trunk/java: engine/org/apache/derby/jdbc/Driver40.java testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41Driver.java
Date Mon, 07 Feb 2011 19:34:03 GMT
Author: rhillegas
Date: Mon Feb  7 19:34:02 2011
New Revision: 1068073

URL: http://svn.apache.org/viewvc?rev=1068073&view=rev
Log:
DERBY-4869: Attempt to fix problem in tinderbox tests introduced by a previous commit today.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41Driver.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java?rev=1068073&r1=1068072&r2=1068073&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java Mon Feb  7 19:34:02
2011
@@ -45,7 +45,9 @@ import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.CallableStatement;
 import java.sql.PreparedStatement;
+import java.sql.SQLFeatureNotSupportedException;
 import java.util.Properties;
+import java.util.logging.Logger;
 import org.apache.derby.iapi.sql.ResultColumnDescriptor;
 
 /** -- jdbc 2.0. extension -- */
@@ -189,4 +191,17 @@ public class Driver40 extends Driver30 {
         return new EmbedXAConnection40(
             eds, ra, user, password, requestPassword);
     }
+    
+    ////////////////////////////////////////////////////////////////////
+    //
+    // INTRODUCED BY JDBC 4.1 IN JAVA 7
+    //
+    ////////////////////////////////////////////////////////////////////
+
+    public  Logger getParentLogger()
+        throws SQLFeatureNotSupportedException
+    {
+        throw (SQLFeatureNotSupportedException) Util.notImplemented( "getParentLogger()"
);
+    }
+
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41Driver.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41Driver.java?rev=1068073&r1=1068072&r2=1068073&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41Driver.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41Driver.java
Mon Feb  7 19:34:02 2011
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
 
 import org.apache.derby.jdbc.AutoloadedDriver40;
 import org.apache.derby.jdbc.ClientDriver40;
+import org.apache.derby.jdbc.Driver40;
 
 /**
  * A wrapper around the methods added by JDBC 4.1.
@@ -42,6 +43,7 @@ public  class   Wrapper41Driver
     ///////////////////////////////////////////////////////////////////////
 
     private AutoloadedDriver40    _embedded;
+    private Driver40            _driver40;
     private ClientDriver40      _netclient;
     
     ///////////////////////////////////////////////////////////////////////
@@ -53,8 +55,9 @@ public  class   Wrapper41Driver
     public Wrapper41Driver( Object wrapped ) throws Exception
     {
         if ( wrapped instanceof AutoloadedDriver40 ) { _embedded = (AutoloadedDriver40) wrapped;
}
+        else if ( wrapped instanceof Driver40 ) { _driver40 = (Driver40) wrapped; }
         else if ( wrapped instanceof ClientDriver40 ) { _netclient = (ClientDriver40) wrapped;
}
-        else { throw nothingWrapped(); }
+        else { throw nothingWrapped( wrapped ); }
     }
     
     ///////////////////////////////////////////////////////////////////////
@@ -66,8 +69,9 @@ public  class   Wrapper41Driver
     public  Logger    getParentLogger() throws SQLException
     {
         if ( _embedded != null ) { return _embedded.getParentLogger(); }
+        else if ( _driver40 != null ) { return _driver40.getParentLogger(); }
         else if ( _netclient != null ) { return _netclient.getParentLogger(); }
-        else { throw nothingWrapped(); }
+        else { throw nothingWrapped( null ); }
     }
 
     ///////////////////////////////////////////////////////////////////////
@@ -79,8 +83,9 @@ public  class   Wrapper41Driver
     public Driver   getWrappedObject() throws SQLException
     {
         if ( _embedded != null ) { return _embedded; }
+        else if ( _driver40 != null ) { return _driver40; }
         else if ( _netclient != null ) { return _netclient; }
-        else { throw nothingWrapped(); }
+        else { throw nothingWrapped( null ); }
     }
 
     ///////////////////////////////////////////////////////////////////////
@@ -89,7 +94,11 @@ public  class   Wrapper41Driver
     //
     ///////////////////////////////////////////////////////////////////////
 
-    private SQLException nothingWrapped() { return new SQLException( "Nothing wrapped!" );
}
+    private SQLException nothingWrapped( Object wrapped )
+    {
+        String  wrappedString = (wrapped == null ? "NULL" : wrapped.getClass().getName()
);
+        return new SQLException( "Nothing wrapped: " + wrappedString );
+    }
 
 }
 



Mime
View raw message