db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1430648 [1/4] - in /db/derby/code/trunk: java/client/org/apache/derby/client/ java/client/org/apache/derby/client/am/ java/client/org/apache/derby/client/net/ java/client/org/apache/derby/jdbc/ java/testing/org/apache/derbyTesting/function...
Date Wed, 09 Jan 2013 01:24:35 GMT
Author: dag
Date: Wed Jan  9 01:24:35 2013
New Revision: 1430648

URL: http://svn.apache.org/viewvc?rev=1430648&view=rev
Log:
DERBY-5955 Prepare Derby to run with Compact Profiles (JEP 161) 

Patch derby-5955-client-restructure-02 (as modified by the delta patch
derby-5955-client-restructure-02-delta.diff) restructures the client
data source hierarchy in anticipation for the non-JNDI dependent
datasources to be introduced into Derby to work on SE with compact
profile 2. The current API is kept as is.


Added:
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java   (with props)
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSourceInterface.java   (with props)
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSourceInterface.java   (with props)
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java   (with props)
Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/OpenSocketAction.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTrajectoryTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/J2EEDataSource.java
    db/derby/code/trunk/tools/jar/dnc.properties

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java Wed Jan  9 01:24:35 2013
@@ -32,7 +32,7 @@ import org.apache.derby.client.am.stmtca
 import org.apache.derby.client.net.NetLogWriter;
 import org.apache.derby.client.net.NetXAConnection;
 import org.apache.derby.iapi.error.ExceptionSeverity;
-import org.apache.derby.jdbc.ClientBaseDataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 import org.apache.derby.jdbc.ClientDriver;
 import org.apache.derby.shared.common.reference.SQLState;
 
@@ -92,7 +92,7 @@ public class ClientPooledConnection impl
      * @throws SQLException if creating the pooled connection fails due problems
      *      in the database, or problems communicating with the database
      */
-    public ClientPooledConnection(ClientBaseDataSource ds,
+    public ClientPooledConnection(ClientBaseDataSourceRoot ds,
                                   org.apache.derby.client.am.LogWriter logWriter,
                                   String user,
                                   String password) throws SQLException {
@@ -142,7 +142,7 @@ public class ClientPooledConnection impl
      * @throws SQLException if creating the pooled connection fails due problems
      *      in the database, or problems communicating with the database
      */
-    public ClientPooledConnection(ClientBaseDataSource ds,
+    public ClientPooledConnection(ClientBaseDataSourceRoot ds,
                                   org.apache.derby.client.am.LogWriter logWriter,
                                   String user,
                                   String password,
@@ -465,7 +465,7 @@ public class ClientPooledConnection impl
      * @param rmId 
      * @return NetXAConnection
      */
-    protected NetXAConnection getNetXAConnection (ClientBaseDataSource ds,
+    protected NetXAConnection getNetXAConnection (ClientBaseDataSourceRoot ds,
                                   NetLogWriter logWriter,
                                   String user,
                                   String password,

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection40.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection40.java Wed Jan  9 01:24:35 2013
@@ -26,7 +26,7 @@ import java.sql.SQLException;
 import java.util.concurrent.CopyOnWriteArrayList;
 import javax.sql.StatementEventListener;
 import javax.sql.StatementEvent;
-import org.apache.derby.jdbc.ClientBaseDataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 
 /**
  *
@@ -47,7 +47,7 @@ public class ClientPooledConnection40 ex
             statementEventListeners =
                     new CopyOnWriteArrayList<StatementEventListener>();
 
-    public ClientPooledConnection40(ClientBaseDataSource ds,
+    public ClientPooledConnection40(ClientBaseDataSourceRoot ds,
         org.apache.derby.client.am.LogWriter logWriter,
         String user,
         String password) throws SQLException {
@@ -56,7 +56,7 @@ public class ClientPooledConnection40 ex
     }
     
     
-    public ClientPooledConnection40(ClientBaseDataSource ds,
+    public ClientPooledConnection40(ClientBaseDataSourceRoot ds,
         org.apache.derby.client.am.LogWriter logWriter,
         String user,
         String password,

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java Wed Jan  9 01:24:35 2013
@@ -29,13 +29,12 @@ import org.apache.derby.client.am.Client
 import org.apache.derby.client.am.SqlException;
 import org.apache.derby.client.net.NetLogWriter;
 import org.apache.derby.client.net.NetXAConnection;
-import org.apache.derby.jdbc.ClientXADataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 import org.apache.derby.shared.common.reference.SQLState;
 
 public class ClientXAConnection extends ClientPooledConnection implements XAConnection {
     private static int rmIdSeed_ = 95688932; // semi-random starting value for rmId
 
-    private ClientXADataSource derbyds_ = null;
     private XAResource xares_ = null;
     private org.apache.derby.client.net.NetXAResource netXares_ = null;
     private boolean fFirstGetConnection_ = true;
@@ -43,12 +42,11 @@ public class ClientXAConnection extends 
     // This connection is used to access the indoubt table
     private NetXAConnection controlCon_ = null;
 
-    public ClientXAConnection(ClientXADataSource ds,
+    public ClientXAConnection(ClientBaseDataSourceRoot ds,
                               org.apache.derby.client.net.NetLogWriter logWtr,
                               String userId,
                               String password) throws SQLException {
         super(ds, logWtr, userId, password, getUnigueRmId());
-        derbyds_ = ds;
 
         // Have to instantiate a real connection here,
         // otherwise if XA function is called before the connect happens,
@@ -96,22 +94,16 @@ public class ClientXAConnection extends 
         return xares_;
     }
 
-    public ClientXADataSource getDataSource() throws SqlException {
-        if (logWriter_ != null) {
-            logWriter_.traceExit(this, "getDataSource", derbyds_);
-        }
 
-        return derbyds_;
-    }
+    public NetXAConnection createControlConnection(
+            NetLogWriter logWriter,
+            String user,
+            String password,
+            ClientBaseDataSourceRoot dataSource,
+            int rmId,
+            boolean isXAConn) throws SQLException {
 
-    public NetXAConnection createControlConnection(NetLogWriter logWriter,
-                                                   String user,
-                                                   String password,
-                                                   org.apache.derby.jdbc.ClientDataSource dataSource,
-                                                   int rmId,
-                                                   boolean isXAConn) throws SQLException {
-        try
-        {
+        try {
             controlCon_ = new NetXAConnection(logWriter,
                     user,
                     password,

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection40.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection40.java Wed Jan  9 01:24:35 2013
@@ -26,7 +26,7 @@ import java.sql.SQLException;
 import java.util.concurrent.CopyOnWriteArrayList;
 import javax.sql.StatementEvent;
 import javax.sql.StatementEventListener;
-import org.apache.derby.jdbc.ClientXADataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 
 /**
  * jdbc4.0 implementation of XAConnection
@@ -49,7 +49,7 @@ public class ClientXAConnection40 extend
      * @param userId 
      * @param password 
      */
-    public ClientXAConnection40 (ClientXADataSource ds,
+    public ClientXAConnection40 (ClientBaseDataSourceRoot ds,
                               org.apache.derby.client.net.NetLogWriter logWtr,
                               String userId,
                               String password) throws SQLException {

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java Wed Jan  9 01:24:35 2013
@@ -23,11 +23,10 @@ package org.apache.derby.client.am;
 
 import org.apache.derby.client.ClientPooledConnection;
 import org.apache.derby.client.ClientXAConnection;
-import org.apache.derby.jdbc.ClientDataSource;
 import java.sql.SQLException;
 import org.apache.derby.client.am.stmtcache.JDBCStatementCache;
 import org.apache.derby.client.am.stmtcache.StatementKey;
-import org.apache.derby.jdbc.ClientBaseDataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 
 /**
  *
@@ -44,25 +43,30 @@ public interface ClientJDBCObjectFactory
      * ClientPooledConnection (or ClientPooledConnection40) class which
      * implements javax.sql.PooledConnection
      */
-    ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds,
-            LogWriter logWriter,String user,String password)
-            throws SQLException;
+    ClientPooledConnection newClientPooledConnection(
+            ClientBaseDataSourceRoot ds,
+            LogWriter logWriter,
+            String user,
+            String password) throws SQLException;
     
     /**
      * This method is used to return an instance of
      * ClientPooledConnection(or ClientPooledConnection40) class which
      * implements javax.sql.PooledConnection
      */
-    ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds,
-            LogWriter logWriter,String user,String password,int rmId)
-            throws SQLException;
+    ClientPooledConnection newClientPooledConnection(
+            ClientBaseDataSourceRoot ds,
+            LogWriter logWriter,
+            String user,
+            String password,
+            int rmId) throws SQLException;
     
     /**
      * This method is used to return an instance of
      * ClientXAConnection (or ClientXAConnection40) class which
      * implements javax.sql.XAConnection
      */
-    ClientXAConnection newClientXAConnection(ClientBaseDataSource ds,
+    ClientXAConnection newClientXAConnection(ClientBaseDataSourceRoot ds,
             LogWriter logWriter,String user,String password)
             throws SQLException;
     
@@ -223,7 +227,8 @@ public interface ClientJDBCObjectFactory
      */
     org.apache.derby.client.am.Connection newNetConnection(
             LogWriter netLogWriter,
-            org.apache.derby.jdbc.ClientBaseDataSource clientDataSource,String user,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot clientDataSource,
+            String user,
             String password) throws SqlException;
     
     /**
@@ -244,8 +249,10 @@ public interface ClientJDBCObjectFactory
      */
     org.apache.derby.client.am.Connection newNetConnection(
             LogWriter netLogWriter,
-            String user,String password,
-            org.apache.derby.jdbc.ClientBaseDataSource dataSource,int rmId,
+            String user,
+            String password,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource,
+            int rmId,
             boolean isXAConn) throws SqlException;
     
     /**
@@ -255,8 +262,10 @@ public interface ClientJDBCObjectFactory
      * java.sql.Connection interface
      */
     org.apache.derby.client.am.Connection newNetConnection(
-            LogWriter netLogWriter,String ipaddr,
-            int portNumber,org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+            LogWriter netLogWriter,
+            String ipaddr,
+            int portNumber,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource,
             boolean isXAConn) throws SqlException;
     
     /**
@@ -283,7 +292,7 @@ public interface ClientJDBCObjectFactory
     org.apache.derby.client.am.Connection newNetConnection(
             LogWriter netLogWriter,
             String user,String password,
-            org.apache.derby.jdbc.ClientBaseDataSource dataSource,int rmId,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource,int rmId,
             boolean isXAConn,ClientPooledConnection cpc) throws SqlException;
     
     /**

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java Wed Jan  9 01:24:35 2013
@@ -28,6 +28,7 @@ import java.security.PrivilegedException
 
 import org.apache.derby.iapi.services.info.ProductGenusNames;
 import org.apache.derby.iapi.services.info.ProductVersionHolder;
+import org.apache.derby.jdbc.ClientDataSourceInterface;
 import org.apache.derby.shared.common.reference.SQLState;
 
 public class Configuration {
@@ -35,7 +36,7 @@ public class Configuration {
 
     public static int traceFileSuffixIndex__ = 0;
 
-    public static int traceLevel__ = org.apache.derby.jdbc.ClientBaseDataSource.TRACE_ALL;
+    public static int traceLevel__ = ClientDataSourceInterface.TRACE_ALL;
 
     public static String traceFile__ = null;
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java Wed Jan  9 01:24:35 2013
@@ -29,8 +29,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.WeakHashMap;
 import org.apache.derby.client.net.NetXAResource;
-import org.apache.derby.jdbc.ClientBaseDataSource;
-import org.apache.derby.jdbc.ClientDataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 import org.apache.derby.shared.common.reference.SQLState;
 import org.apache.derby.shared.common.sanity.SanityManager;
 
@@ -170,10 +169,10 @@ public abstract class Connection
     public int xaHostVersion_ = 0;
 
     public int loginTimeout_;
-    public org.apache.derby.jdbc.ClientBaseDataSource dataSource_;
+    public org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource_;
     public String serverNameIP_;
     public int portNumber_;
-    public int clientSSLMode_ = ClientBaseDataSource.SSL_OFF;
+    public int clientSSLMode_ = ClientBaseDataSourceRoot.SSL_OFF;
 
     Hashtable<String, String> clientCursorNameCache_ =
             new Hashtable<String, String>();
@@ -186,30 +185,36 @@ public abstract class Connection
     //---------------------constructors/finalizer---------------------------------
 
     // For jdbc 2 connections
-    protected Connection(org.apache.derby.client.am.LogWriter logWriter,
-                         String user,
-                         String password,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource) 
-                                                           throws SqlException {
+    protected Connection(
+            org.apache.derby.client.am.LogWriter logWriter,
+            String user,
+            String password,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource)
+            throws SqlException {
+
         this.user_ = user;
         initConnection(logWriter, dataSource);
     }
 
-    protected Connection(org.apache.derby.client.am.LogWriter logWriter,
-                         String user,
-                         String password,
-                         boolean isXAConn,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource) 
-                                                           throws SqlException {
+    protected Connection(
+            org.apache.derby.client.am.LogWriter logWriter,
+            String user,
+            String password,
+            boolean isXAConn,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource)
+            throws SqlException {
+
         this.user_ = user;
         isXAConnection_ = isXAConn;
         initConnection(logWriter, dataSource);
     }
 
     // For jdbc 2 connections
-    protected void initConnection(org.apache.derby.client.am.LogWriter logWriter,
-                                  org.apache.derby.jdbc.ClientBaseDataSource
-                                            dataSource) throws SqlException {
+    protected void initConnection(
+            org.apache.derby.client.am.LogWriter logWriter,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource)
+            throws SqlException {
+
         if (logWriter != null) {
             logWriter.traceConnectEntry(dataSource);
         }
@@ -247,7 +252,7 @@ public abstract class Connection
         portNumber_ = dataSource.getPortNumber();
 
         clientSSLMode_ = 
-            ClientBaseDataSource.getSSLModeFromString(dataSource.getSsl());
+            ClientBaseDataSourceRoot.getSSLModeFromString(dataSource.getSsl());
 
         agent_ = newAgent_(logWriter,
                 loginTimeout_,
@@ -257,16 +262,19 @@ public abstract class Connection
     }
 
     // For jdbc 2 connections
-    protected Connection(org.apache.derby.client.am.LogWriter logWriter,
-                         boolean isXAConn,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource) 
-                                                            throws SqlException {
+    protected Connection(
+            org.apache.derby.client.am.LogWriter logWriter,
+            boolean isXAConn,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource)
+            throws SqlException {
+
         if (logWriter != null) {
             logWriter.traceConnectEntry(dataSource);
         }
+
         isXAConnection_ = isXAConn;
 
-        user_ = ClientDataSource.propertyDefault_user;
+        user_ = ClientBaseDataSourceRoot.propertyDefault_user;
 
         // Extract common properties.
         databaseName_ = dataSource.getDatabaseName();
@@ -279,7 +287,7 @@ public abstract class Connection
         portNumber_ = dataSource.getPortNumber();
 
         clientSSLMode_ = 
-            ClientBaseDataSource.getSSLModeFromString(dataSource.getSsl());
+            ClientBaseDataSourceRoot.getSSLModeFromString(dataSource.getSsl());
 
         agent_ = newAgent_(logWriter,
                 loginTimeout_,
@@ -323,13 +331,14 @@ public abstract class Connection
         databaseName_ = databaseName;
 
         // Extract common properties.
-        user_ = ClientDataSource.getUser(properties);
-        retrieveMessageText_ = ClientDataSource.getRetrieveMessageText(properties);
+        user_ = ClientBaseDataSourceRoot.getUser(properties);
+        retrieveMessageText_ =
+            ClientBaseDataSourceRoot.getRetrieveMessageText(properties);
 
         loginTimeout_ = driverManagerLoginTimeout;
         serverNameIP_ = serverName;
         portNumber_ = portNumber;
-        clientSSLMode_ = ClientDataSource.getClientSSLMode(properties);
+        clientSSLMode_ = ClientBaseDataSourceRoot.getClientSSLMode(properties);
 
         agent_ = newAgent_(logWriter,
                 loginTimeout_,

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java Wed Jan  9 01:24:35 2013
@@ -23,16 +23,15 @@ package org.apache.derby.client.am;
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
 import java.sql.SQLException;
-import java.util.Enumeration;
 import java.util.Properties;
-import javax.naming.NamingException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-import org.apache.derby.jdbc.ClientBaseDataSource;
-import org.apache.derby.jdbc.ClientDataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
+import org.apache.derby.jdbc.ClientDataSourceInterface;
 import org.apache.derby.shared.common.reference.Attribute;
 import org.apache.derby.shared.common.reference.SQLState;
 
@@ -212,49 +211,60 @@ public class LogWriter {
         if (instance == null) // this prevents NPE from instance.getClass() used below
         {
             return null;
-        } else if (instance instanceof Connection && loggingEnabled(ClientDataSource.TRACE_CONNECTION_CALLS)) {
+        } else if (instance instanceof Connection && loggingEnabled(
+                ClientDataSourceInterface.TRACE_CONNECTION_CALLS)) {
             return "Connection";
-        } else if (instance instanceof ResultSet && loggingEnabled(ClientDataSource.TRACE_RESULT_SET_CALLS)) {
+        } else if (instance instanceof ResultSet && loggingEnabled(
+                ClientDataSourceInterface.TRACE_RESULT_SET_CALLS)) {
             return "ResultSet";
-        } else if (instance instanceof CallableStatement && loggingEnabled(ClientDataSource.TRACE_STATEMENT_CALLS)) {
+        } else if (instance instanceof CallableStatement && loggingEnabled(
+                ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {
             return "CallableStatement";
-        } else if (instance instanceof PreparedStatement && loggingEnabled(ClientDataSource.TRACE_STATEMENT_CALLS)) {
+        } else if (instance instanceof PreparedStatement && loggingEnabled(
+                ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {
             return "PreparedStatement";
-        } else if (instance instanceof Statement && loggingEnabled(ClientDataSource.TRACE_STATEMENT_CALLS)) {
+        } else if (instance instanceof Statement && loggingEnabled(
+                ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {
             return "Statement";
         }
         // Not yet externalizing Blob tracing, except for trace_all
-        else if (instance instanceof Blob && loggingEnabled(ClientDataSource.TRACE_ALL)) // add a trace level for lobs !!
+        else if (instance instanceof Blob && loggingEnabled(
+                ClientDataSourceInterface.TRACE_ALL)) // add a trace level for
+                                                      // lobs !!
         {
             return "Blob";
         }
         // Not yet externalizing Clob tracing, except for trace_all
-        else if (instance instanceof Clob && loggingEnabled(ClientDataSource.TRACE_ALL)) // add a trace level for bobs !!
+        else if (instance instanceof Clob && loggingEnabled(
+                ClientDataSourceInterface.TRACE_ALL)) // add a trace level for
+                                                      // bobs !!
         {
             return "Clob";
         }
         // Not yet externalizing dbmd catalog call tracing, except for trace_all
-        else if (instance instanceof DatabaseMetaData && loggingEnabled(ClientDataSource.TRACE_ALL)) // add a trace level for dbmd ??
+        else if (instance instanceof DatabaseMetaData && loggingEnabled(
+                ClientDataSourceInterface.TRACE_ALL)) // add a trace level for
+                                                      // dbmd ??
         {
             return "DatabaseMetaData";
         }
         // we don't use instanceof javax.transaction.XAResource to avoid dependency on j2ee.jar
-        else if (loggingEnabled(ClientDataSource.TRACE_XA_CALLS) &&
+        else if (loggingEnabled(ClientDataSourceInterface.TRACE_XA_CALLS) &&
                 instance.getClass().getName().startsWith("org.apache.derby.client.net.NetXAResource")) {
             return "NetXAResource";
-        } else if (loggingEnabled(ClientDataSource.TRACE_ALL) &&
+        } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&
                 instance.getClass().getName().equals("org.apache.derby.client.ClientPooledConnection")) {
             return "ClientPooledConnection";
-        } else if (loggingEnabled(ClientDataSource.TRACE_ALL) &&
+        } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&
                 instance.getClass().getName().equals("org.apache.derby.jdbc.ClientConnectionPoolDataSource")) {
             return "ClientConnectionPoolDataSource";
-        } else if (loggingEnabled(ClientDataSource.TRACE_ALL) &&
+        } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&
                 instance.getClass().getName().equals("org.apache.derby.client.ClientXAConnection")) {
             return "ClientXAConnection";
-        } else if (loggingEnabled(ClientDataSource.TRACE_ALL) &&
+        } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&
                 instance.getClass().getName().equals("org.apache.derby.jdbc.ClientDataSource")) {
             return "ClientDataSource";
-        } else if (loggingEnabled(ClientDataSource.TRACE_ALL) &&
+        } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&
                 instance.getClass().getName().equals("org.apache.derby.jdbc.ClientXADataSource")) {
             return "ClientXADataSource";
         } else {
@@ -845,7 +855,7 @@ public class LogWriter {
         if (traceSuspended()) {
             return;
         }
-        if (!loggingEnabled(ClientDataSource.TRACE_DIAGNOSTICS)) {
+        if (!loggingEnabled(ClientDataSourceInterface.TRACE_DIAGNOSTICS)) {
             return;
         }
         synchronized (printWriter_) {
@@ -858,7 +868,7 @@ public class LogWriter {
         if (traceSuspended()) {
             return;
         }
-        if (!loggingEnabled(ClientDataSource.TRACE_DIAGNOSTICS)) {
+        if (!loggingEnabled(ClientDataSourceInterface.TRACE_DIAGNOSTICS)) {
             return;
         }
         synchronized (printWriter_) {
@@ -872,7 +882,7 @@ public class LogWriter {
         if (traceSuspended()) {
             return;
         }
-        if (!loggingEnabled(ClientDataSource.TRACE_DIAGNOSTICS)) {
+        if (!loggingEnabled(ClientDataSourceInterface.TRACE_DIAGNOSTICS)) {
             return;
         }
         synchronized (printWriter_) {
@@ -887,7 +897,9 @@ public class LogWriter {
         if (traceSuspended()) {
             return;
         }
-        if (!loggingEnabled(ClientDataSource.TRACE_PARAMETER_META_DATA) || columnMetaData == null) {
+        if (!loggingEnabled(
+                ClientDataSourceInterface.TRACE_PARAMETER_META_DATA) ||
+                columnMetaData == null) {
             return;
         }
         synchronized (printWriter_) {
@@ -909,7 +921,9 @@ public class LogWriter {
         if (traceSuspended()) {
             return;
         }
-        if (!loggingEnabled(ClientDataSource.TRACE_RESULT_SET_META_DATA) || columnMetaData == null) {
+        if (!loggingEnabled(
+                ClientDataSourceInterface.TRACE_RESULT_SET_META_DATA) ||
+                columnMetaData == null) {
             return;
         }
         synchronized (printWriter_) {
@@ -990,14 +1004,15 @@ public class LogWriter {
     // Including protocol manager levels, and driver configuration
 
     // Jdbc 2
-    public void traceConnectEntry(ClientBaseDataSource dataSource) {
+    public void traceConnectEntry(ClientBaseDataSourceRoot dataSource) {
         if (traceSuspended()) {
             return;
         }
-        if (loggingEnabled(ClientDataSource.TRACE_DRIVER_CONFIGURATION)) {
+        if (loggingEnabled(
+                ClientDataSourceInterface.TRACE_DRIVER_CONFIGURATION)) {
             traceDriverConfigurationJdbc2();
         }
-        if (loggingEnabled(ClientDataSource.TRACE_CONNECTS)) {
+        if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {
             traceConnectsEntry(dataSource);
         }
     }
@@ -1010,21 +1025,24 @@ public class LogWriter {
         if (traceSuspended()) {
             return;
         }
-        if (loggingEnabled(ClientDataSource.TRACE_DRIVER_CONFIGURATION)) {
+        if (loggingEnabled(
+                ClientDataSourceInterface.TRACE_DRIVER_CONFIGURATION)) {
             traceDriverConfigurationJdbc1();
         }
-        if (loggingEnabled(ClientDataSource.TRACE_CONNECTS)) {
+        if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {
             traceConnectsEntry(server, port, database, properties);
         }
     }
 
-    public void traceConnectResetEntry(Object instance, LogWriter logWriter, 
-                                        String user, ClientBaseDataSource ds) {
+    public void traceConnectResetEntry(
+            Object instance, LogWriter logWriter,
+            String user, ClientBaseDataSourceRoot ds) {
+
         if (traceSuspended()) {
             return;
         }
         traceEntry(instance, "reset", logWriter, user, "<escaped>", ds);
-        if (loggingEnabled(ClientDataSource.TRACE_CONNECTS)) {
+        if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {
             traceConnectsResetEntry(ds);
         }
     }
@@ -1033,7 +1051,7 @@ public class LogWriter {
         if (traceSuspended()) {
             return;
         }
-        if (loggingEnabled(ClientDataSource.TRACE_CONNECTS)) {
+        if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {
             traceConnectsExit(connection);
         }
     }
@@ -1042,7 +1060,7 @@ public class LogWriter {
         if (traceSuspended()) {
             return;
         }
-        if (loggingEnabled(ClientDataSource.TRACE_CONNECTS)) {
+        if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {
             traceConnectsResetExit(connection);
         }
     }
@@ -1050,7 +1068,7 @@ public class LogWriter {
 
     // ---------------------- tracing connects -----------------------------------
 
-    private void traceConnectsResetEntry(ClientBaseDataSource dataSource) {
+    private void traceConnectsResetEntry(ClientBaseDataSourceRoot dataSource) {
         try {
             if (traceSuspended()) {
                 return;
@@ -1064,7 +1082,7 @@ public class LogWriter {
         }
     }
 
-    private void traceConnectsEntry(ClientBaseDataSource dataSource) {
+    private void traceConnectsEntry(ClientBaseDataSourceRoot dataSource) {
         try {
             if (traceSuspended()) {
                 return;
@@ -1245,38 +1263,17 @@ public class LogWriter {
     }
     
     /**
-     * Obtain a set of Properties for the ClientBaseDataSource
+     * Obtain a set of Properties for the client data source.
      */
-    private Properties getProperties(ClientBaseDataSource cds)
+    private Properties getProperties(ClientBaseDataSourceRoot cds)
     throws SqlException {
         
-        Properties properties = new Properties();
-        
-        try {
-            Reference ref = cds.getReference();
-            
-            for (Enumeration e = ref.getAll(); e.hasMoreElements();) {
-
-                RefAddr attribute = (RefAddr) e.nextElement();
-
-                String propertyKey = attribute.getType();
-                String value = (String) attribute.getContent();
-                
-                // Don't display the password or even its length
-                if (Attribute.PASSWORD_ATTR.equals(propertyKey)) {
-                    value = "********";
-                }
-                
-                if(value != null)
-                    properties.setProperty(propertyKey, value);
-            }
-        } catch (NamingException e) {
-            throw new SqlException(this, 
-                new ClientMessageId(SQLState.JAVA_EXCEPTION),
-                e.getClass().getName(), e.getMessage(), e);
+        Properties properties = ClientBaseDataSourceRoot.getProperties(cds);
+
+        if (properties.getProperty(Attribute.PASSWORD_ATTR) != null) {
+            properties.setProperty(Attribute.PASSWORD_ATTR, "********");
         }
-        
+
         return properties;
     }
-
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java Wed Jan  9 01:24:35 2013
@@ -21,8 +21,6 @@
 
 package org.apache.derby.client.net;
 
-import java.rmi.UnexpectedException;
-import java.sql.Connection;
 import java.sql.SQLException;
 import org.apache.derby.client.ClientPooledConnection;
 import org.apache.derby.client.ClientXAConnection;
@@ -32,7 +30,6 @@ import org.apache.derby.client.am.Client
 import org.apache.derby.client.am.LogicalConnection;
 import org.apache.derby.client.am.ParameterMetaData;
 import org.apache.derby.client.am.PreparedStatement;
-import org.apache.derby.client.am.Configuration;
 import org.apache.derby.client.am.LogicalCallableStatement;
 import org.apache.derby.client.am.LogicalPreparedStatement;
 import org.apache.derby.client.am.LogWriter;
@@ -43,9 +40,7 @@ import org.apache.derby.client.am.SqlExc
 import org.apache.derby.client.am.Cursor;
 import org.apache.derby.client.am.stmtcache.JDBCStatementCache;
 import org.apache.derby.client.am.stmtcache.StatementKey;
-import org.apache.derby.client.net.NetLogWriter;
-import org.apache.derby.jdbc.ClientBaseDataSource;
-import org.apache.derby.jdbc.ClientXADataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 import org.apache.derby.client.am.ColumnMetaData;
 import org.apache.derby.client.am.StatementCacheInteractor;
 
@@ -60,26 +55,33 @@ public class ClientJDBCObjectFactoryImpl
     /**
      * Returns an instance of org.apache.derby.client.ClientPooledConnection 
      */
-    public ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds,
-            LogWriter logWriter,String user,
+    public ClientPooledConnection newClientPooledConnection(
+            ClientBaseDataSourceRoot ds,
+            LogWriter logWriter,
+            String user,
             String password) throws SQLException {
+
         return new ClientPooledConnection(ds,logWriter,user,password);
     }
     /**
      * Returns an instance of org.apache.derby.client.ClientPooledConnection 
      */
-    public ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds,
-            LogWriter logWriter,String user,
-            String password,int rmId) throws SQLException {
+    public ClientPooledConnection newClientPooledConnection(
+            ClientBaseDataSourceRoot ds,
+            LogWriter logWriter,
+            String user,
+            String password,
+            int rmId) throws SQLException {
+
         return new ClientPooledConnection(ds,logWriter,user,password,rmId);
     }
     /**
      * Returns an instance of org.apache.derby.client.ClientXAConnection 
      */
-    public ClientXAConnection newClientXAConnection(ClientBaseDataSource ds,
+    public ClientXAConnection newClientXAConnection(ClientBaseDataSourceRoot ds,
         LogWriter logWriter,String user, String password) throws SQLException
     {
-        return new ClientXAConnection((ClientXADataSource)ds,
+        return new ClientXAConnection(ds,
             (NetLogWriter)logWriter,user,password);
     }
     /**
@@ -253,7 +255,7 @@ public class ClientJDBCObjectFactoryImpl
      */
     public org.apache.derby.client.am.Connection newNetConnection(
             org.apache.derby.client.am.LogWriter netLogWriter,
-            org.apache.derby.jdbc.ClientBaseDataSource clientDataSource,
+            ClientBaseDataSourceRoot clientDataSource,
             String user,String password) throws SqlException {
         return  (org.apache.derby.client.am.Connection)
         (new NetConnection((NetLogWriter)netLogWriter,clientDataSource
@@ -277,7 +279,7 @@ public class ClientJDBCObjectFactoryImpl
     public org.apache.derby.client.am.Connection newNetConnection(
             org.apache.derby.client.am.LogWriter netLogWriter,String user,
             String password,
-            org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+            ClientBaseDataSourceRoot dataSource,
             int rmId,boolean isXAConn) throws SqlException {
         return (org.apache.derby.client.am.Connection)
         (new NetConnection((NetLogWriter)netLogWriter,user,password,dataSource,rmId,
@@ -289,7 +291,7 @@ public class ClientJDBCObjectFactoryImpl
     public org.apache.derby.client.am.Connection newNetConnection(
             org.apache.derby.client.am.LogWriter netLogWriter,
             String ipaddr,int portNumber,
-            org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+            ClientBaseDataSourceRoot dataSource,
             boolean isXAConn) throws SqlException {
         return (org.apache.derby.client.am.Connection)
         new NetConnection((NetLogWriter)netLogWriter,ipaddr,portNumber,dataSource,
@@ -315,7 +317,7 @@ public class ClientJDBCObjectFactoryImpl
     public org.apache.derby.client.am.Connection newNetConnection(
             org.apache.derby.client.am.LogWriter netLogWriter,String user,
             String password,
-            org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+            ClientBaseDataSourceRoot dataSource,
             int rmId,boolean isXAConn,
             ClientPooledConnection cpc) throws SqlException {
         return (org.apache.derby.client.am.Connection)

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java Wed Jan  9 01:24:35 2013
@@ -46,8 +46,7 @@ import org.apache.derby.client.am.SqlExc
 import org.apache.derby.client.am.StatementCacheInteractor;
 import org.apache.derby.client.am.stmtcache.JDBCStatementCache;
 import org.apache.derby.client.am.stmtcache.StatementKey;
-import org.apache.derby.jdbc.ClientBaseDataSource;
-import org.apache.derby.jdbc.ClientXADataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 
 /**
  * Implements the ClientJDBCObjectFactory interface and returns the JDBC 4.0
@@ -67,7 +66,7 @@ public class ClientJDBCObjectFactoryImpl
      * Returns an instance of org.apache.derby.client.ClientPooledConnection40 
      */
     public ClientPooledConnection newClientPooledConnection(
-            ClientBaseDataSource ds, LogWriter logWriter,String user,
+            ClientBaseDataSourceRoot ds, LogWriter logWriter,String user,
             String password) throws SQLException {
         return new ClientPooledConnection40(ds,logWriter,user,password);
     }
@@ -75,7 +74,7 @@ public class ClientJDBCObjectFactoryImpl
      * Returns an instance of org.apache.derby.client.ClientPooledConnection40 
      */
     public ClientPooledConnection newClientPooledConnection(
-            ClientBaseDataSource ds, LogWriter logWriter,String user,
+            ClientBaseDataSourceRoot ds, LogWriter logWriter,String user,
             String password,int rmId) throws SQLException {
         return new ClientPooledConnection40(ds,logWriter,user,password,rmId);
     }
@@ -83,10 +82,10 @@ public class ClientJDBCObjectFactoryImpl
      * Returns an instance of org.apache.derby.client.ClientXAConnection40 
      */
     public ClientXAConnection newClientXAConnection(
-        ClientBaseDataSource ds, LogWriter logWriter,String user,
+        ClientBaseDataSourceRoot ds, LogWriter logWriter,String user,
         String password) throws SQLException
     {
-        return new ClientXAConnection40((ClientXADataSource)ds,
+        return new ClientXAConnection40(ds,
             (NetLogWriter)logWriter,user,password);
     }
     /**
@@ -244,7 +243,7 @@ public class ClientJDBCObjectFactoryImpl
      */
     public org.apache.derby.client.am.Connection newNetConnection
             (org.apache.derby.client.am.LogWriter netLogWriter,
-            org.apache.derby.jdbc.ClientBaseDataSource clientDataSource,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot clientDataSource,
             String user,String password) throws SqlException {
         return (org.apache.derby.client.am.Connection)
         (new NetConnection40((NetLogWriter)netLogWriter,clientDataSource,user,password));
@@ -268,7 +267,7 @@ public class ClientJDBCObjectFactoryImpl
             newNetConnection(org.apache.derby.client.am.LogWriter netLogWriter,
             String user,
             String password,
-            org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource,
             int rmId,boolean isXAConn) throws SqlException {
         return (org.apache.derby.client.am.Connection)
         (new NetConnection40((NetLogWriter)netLogWriter,user,password,dataSource,
@@ -280,7 +279,7 @@ public class ClientJDBCObjectFactoryImpl
     public org.apache.derby.client.am.Connection
             newNetConnection(org.apache.derby.client.am.LogWriter netLogWriter,
             String ipaddr,int portNumber,
-            org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource,
             boolean isXAConn) throws SqlException {
         return (org.apache.derby.client.am.Connection)
         (new NetConnection40((NetLogWriter)netLogWriter,ipaddr,portNumber,dataSource,
@@ -305,7 +304,7 @@ public class ClientJDBCObjectFactoryImpl
     public org.apache.derby.client.am.Connection newNetConnection(
             org.apache.derby.client.am.LogWriter netLogWriter,String user,
             String password,
-            org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource,
             int rmId,boolean isXAConn,ClientPooledConnection cpc) 
             throws SqlException {
         return (org.apache.derby.client.am.Connection)

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java Wed Jan  9 01:24:35 2013
@@ -35,7 +35,7 @@ import org.apache.derby.shared.common.re
 import org.apache.derby.shared.common.i18n.MessageUtil;
 import org.apache.derby.client.am.Statement;
 import org.apache.derby.iapi.reference.Attribute;
-import org.apache.derby.jdbc.ClientBaseDataSource;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 import org.apache.derby.jdbc.ClientDriver;
 import org.apache.derby.client.ClientPooledConnection;
 
@@ -190,10 +190,12 @@ public class NetConnection extends org.a
         this.closeStatementsOnClose = true;
     }
 
-    public NetConnection(NetLogWriter netLogWriter,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource,
-                         String user,
-                         String password) throws SqlException {
+    public NetConnection(
+            NetLogWriter netLogWriter,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource,
+            String user,
+            String password) throws SqlException {
+
         super(netLogWriter, user, password, dataSource);
         this.pooledConnection_ = null;
         this.closeStatementsOnClose = true;
@@ -215,8 +217,9 @@ public class NetConnection extends org.a
             throw netAgent_.exceptionOpeningSocket_;
         }
         checkDatabaseName();
-        String password = ClientBaseDataSource.getPassword(properties);
-        securityMechanism_ = ClientBaseDataSource.getSecurityMechanism(properties);
+        String password = ClientBaseDataSourceRoot.getPassword(properties);
+        securityMechanism_ =
+                ClientBaseDataSourceRoot.getSecurityMechanism(properties);
         flowConnect(password, securityMechanism_);
         if(!isConnectionNull())
             completeConnect();
@@ -228,7 +231,7 @@ public class NetConnection extends org.a
     public NetConnection(NetLogWriter netLogWriter,
                          String user,
                          String password,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+                         ClientBaseDataSourceRoot dataSource,
                          int rmId,
                          boolean isXAConn) throws SqlException {
         super(netLogWriter, user, password, isXAConn, dataSource);
@@ -241,7 +244,7 @@ public class NetConnection extends org.a
     public NetConnection(NetLogWriter netLogWriter,
                          String ipaddr,
                          int portNumber,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+                         ClientBaseDataSourceRoot dataSource,
                          boolean isXAConn) throws SqlException {
         super(netLogWriter, isXAConn, dataSource);
         this.pooledConnection_ = null;
@@ -280,7 +283,7 @@ public class NetConnection extends org.a
     public NetConnection(NetLogWriter netLogWriter,
                          String user,
                          String password,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+                         ClientBaseDataSourceRoot dataSource,
                          int rmId,
                          boolean isXAConn,
                          ClientPooledConnection cpc) throws SqlException {
@@ -292,7 +295,7 @@ public class NetConnection extends org.a
     }
 
     private void initialize(String password,
-                            org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+                            ClientBaseDataSourceRoot dataSource,
                             int rmId,
                             boolean isXAConn) throws SqlException {
         securityMechanism_ = dataSource.getSecurityMechanism(password);
@@ -1402,7 +1405,7 @@ public class NetConnection extends org.a
         // Define which userName takes precedence - If we have a dataSource
         // available here, it is posible that the userName has been
         // overriden by some defined as part of the connection attributes
-        // (see ClientBaseDataSource.updateDataSourceValues().
+        // (see ClientBaseDataSourceRoot.updateDataSourceValues().
         // We need to use the right userName as strong password
         // substitution depends on the userName when the substitute
         // password is generated; if we were not using the right userName

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=1430648&r1=1430647&r2=1430648&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 Wed Jan  9 01:24:35 2013
@@ -37,6 +37,7 @@ import org.apache.derby.client.am.Client
 import org.apache.derby.client.am.FailedProperties40;
 import org.apache.derby.client.am.SQLExceptionFactory;
 import org.apache.derby.client.am.SqlException;
+import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 import org.apache.derby.shared.common.reference.SQLState;
 
 public class  NetConnection40 extends org.apache.derby.client.net.NetConnection {
@@ -59,7 +60,7 @@ public class  NetConnection40 extends or
     super(netLogWriter,databaseName,properties);
     }
     public NetConnection40(NetLogWriter netLogWriter,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+                         ClientBaseDataSourceRoot dataSource,
                          String user,
                          String password) throws SqlException {
     super(netLogWriter,dataSource,user,password);
@@ -75,7 +76,7 @@ public class  NetConnection40 extends or
      public NetConnection40(NetLogWriter netLogWriter,
                          String user,
                          String password,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+                         ClientBaseDataSourceRoot dataSource,
                          int rmId,
                          boolean isXAConn) throws SqlException{
     super(netLogWriter,user,password,dataSource,rmId,isXAConn);
@@ -83,7 +84,7 @@ public class  NetConnection40 extends or
     public NetConnection40(NetLogWriter netLogWriter,
                          String ipaddr,
                          int portNumber,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+                         ClientBaseDataSourceRoot dataSource,
                          boolean isXAConn) throws SqlException{
         super(netLogWriter,ipaddr,portNumber,dataSource,isXAConn);
     }
@@ -114,7 +115,7 @@ public class  NetConnection40 extends or
     public NetConnection40(NetLogWriter netLogWriter,
                          String user,
                          String password,
-                         org.apache.derby.jdbc.ClientBaseDataSource dataSource,
+                         ClientBaseDataSourceRoot dataSource,
                          int rmId,
                          boolean isXAConn,
                          ClientPooledConnection cpc) throws SqlException{

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java Wed Jan  9 01:24:35 2013
@@ -63,13 +63,15 @@ public class NetXAConnection {    
      * @throws SqlException
      * 
      */
-    public NetXAConnection(NetLogWriter netLogWriter,
-                           String user,
-                           String password,
-                           org.apache.derby.jdbc.ClientBaseDataSource dataSource,
-                           int rmId,
-                           boolean isXAConn,
-                           ClientPooledConnection cpc) throws SqlException {
+    public NetXAConnection(
+            NetLogWriter netLogWriter,
+            String user,
+            String password,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource,
+            int rmId,
+            boolean isXAConn,
+            ClientPooledConnection cpc) throws SqlException {
+
         netCon = createNetConnection (netLogWriter, user, password, 
                 dataSource, rmId, isXAConn,cpc);
         checkPlatformVersion();
@@ -258,13 +260,15 @@ public class NetXAConnection {    
      * @return NetConnection
      *
      */
-    protected NetConnection createNetConnection (NetLogWriter netLogWriter,
-                           String user,
-                           String password,
-                           org.apache.derby.jdbc.ClientBaseDataSource dataSource,
-                           int rmId,
-                           boolean isXAConn,
-                           ClientPooledConnection cpc) throws SqlException {        
+    protected NetConnection createNetConnection (
+            NetLogWriter netLogWriter,
+            String user,
+            String password,
+            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource,
+            int rmId,
+            boolean isXAConn,
+            ClientPooledConnection cpc) throws SqlException {
+
         return (NetConnection)ClientDriver.getFactory().newNetConnection
             (netLogWriter, user, password,dataSource, rmId, isXAConn,cpc);
     }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/OpenSocketAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/OpenSocketAction.java?rev=1430648&r1=1430647&r2=1430648&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/OpenSocketAction.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/OpenSocketAction.java Wed Jan  9 01:24:35 2013
@@ -51,13 +51,14 @@ public class OpenSocketAction implements
         
         SocketFactory sf;
         switch (clientSSLMode_) {
-        case org.apache.derby.jdbc.ClientBaseDataSource.SSL_BASIC:
+        case org.apache.derby.jdbc.ClientBaseDataSourceRoot.SSL_BASIC:
             sf = NaiveTrustManager.getSocketFactory();
             break;
-        case org.apache.derby.jdbc.ClientBaseDataSource.SSL_PEER_AUTHENTICATION:
+        case org.apache.derby.jdbc.ClientBaseDataSourceRoot.
+                SSL_PEER_AUTHENTICATION:
             sf = (SocketFactory)SSLSocketFactory.getDefault();
             break;
-        case org.apache.derby.jdbc.ClientBaseDataSource.SSL_OFF:
+        case org.apache.derby.jdbc.ClientBaseDataSourceRoot.SSL_OFF:
             sf = SocketFactory.getDefault();
             break;
         default: 



Mime
View raw message