db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1489349 - in /db/derby/code/trunk/java: client/org/apache/derby/jdbc/ engine/org/apache/derby/jdbc/ testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ testing/org/apache/derbyTesting/functionTests/tests/store/ tools/org/apache/derb...
Date Tue, 04 Jun 2013 09:09:36 GMT
Author: kahatlen
Date: Tue Jun  4 09:09:36 2013
New Revision: 1489349

URL: http://svn.apache.org/r1489349
Log:
DERBY-6213: Deprecate support for Java 5 and CDC

Add @deprecated tag to the DataSource classes that have been removed
from the public API.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java
    db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource40.java
    db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedDataSource40.java
    db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSource40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41DataSource.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
    db/derby/code/trunk/java/tools/org/apache/derby/tools/SignatureChecker.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java?rev=1489349&r1=1489348&r2=1489349&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java
Tue Jun  4 09:09:36 2013
@@ -30,6 +30,7 @@ import javax.sql.ConnectionPoolDataSourc
    Now that we no longer support Java 5, all functionality has migrated into the superclass,
ClientConnectionPoolDataSource.
    This class is preserved for backward compatibility reasons.
    </P>
+   @deprecated Use {@link ClientConnectionPoolDataSource} instead.
  */
 public class ClientConnectionPoolDataSource40
     extends ClientConnectionPoolDataSource

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java?rev=1489349&r1=1489348&r2=1489349&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java Tue Jun
 4 09:09:36 2013
@@ -30,6 +30,7 @@ import javax.sql.DataSource;
    Now that we no longer support Java 5, all functionality has migrated into the superclass,
ClientDataSource.
    This class is preserved for backward compatibility reasons.
    </P>
+   @deprecated Use {@link ClientDataSource} instead.
  */
 public class ClientDataSource40 extends ClientDataSource
     implements DataSource /* compile-time check for 4.1 extension */

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java?rev=1489349&r1=1489348&r2=1489349&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java Tue Jun
 4 09:09:36 2013
@@ -30,6 +30,7 @@ import javax.sql.XADataSource;
    Now that we no longer support Java 5, all functionality has migrated into the superclass,
ClientXADataSource.
    This class is preserved for backward compatibility reasons.
    </P>
+   @deprecated Use {@link ClientXADataSource} instead.
  */
 public class ClientXADataSource40 extends ClientXADataSource
     implements XADataSource /* compile-time check for 4.1 extension */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource40.java?rev=1489349&r1=1489348&r2=1489349&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource40.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource40.java
Tue Jun  4 09:09:36 2013
@@ -27,6 +27,7 @@ package org.apache.derby.jdbc;
    Now that we no longer support Java 5, all functionality has migrated into the superclass,
EmbeddedConnectionPoolDataSource.
    This class is preserved for backward compatibility reasons.
    </P>
+   @deprecated Use {@link EmbeddedConnectionPoolDataSource} instead.
  */
 public class EmbeddedConnectionPoolDataSource40 
     extends EmbeddedConnectionPoolDataSource

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedDataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedDataSource40.java?rev=1489349&r1=1489348&r2=1489349&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedDataSource40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedDataSource40.java Tue Jun
 4 09:09:36 2013
@@ -28,6 +28,7 @@ package org.apache.derby.jdbc;
    Now that we no longer support Java 5, all functionality has migrated into the superclass,
EmbeddedDataSource.
    This class is preserved for backward compatibility reasons.
    </P>
+   @deprecated Use {@link EmbeddedDataSource} instead.
 */
 public class EmbeddedDataSource40 extends EmbeddedDataSource
     implements javax.sql.DataSource /* compile-time check for 4.1 extension */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSource40.java?rev=1489349&r1=1489348&r2=1489349&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSource40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSource40.java Tue
Jun  4 09:09:36 2013
@@ -28,6 +28,7 @@ package org.apache.derby.jdbc;
    Now that we no longer support Java 5, all functionality has migrated into the superclass,
EmbeddedXADataSource.
    This class is preserved for backward compatibility reasons.
    </P>
+   @deprecated Use {@link EmbeddedXADataSource} instead.
  */
 public class EmbeddedXADataSource40 extends EmbeddedXADataSource
     implements javax.sql.XADataSource /* compile-time check for 4.1 extension */

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41DataSource.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41DataSource.java?rev=1489349&r1=1489348&r2=1489349&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41DataSource.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41DataSource.java
Tue Jun  4 09:09:36 2013
@@ -24,14 +24,14 @@ package org.apache.derbyTesting.function
 import java.sql.SQLException;
 import java.util.logging.Logger;
 import javax.sql.CommonDataSource;
-import org.apache.derby.jdbc.ClientConnectionPoolDataSource40;
-import org.apache.derby.jdbc.ClientDataSource40;
-import org.apache.derby.jdbc.ClientXADataSource40;
-import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40;
-import org.apache.derby.jdbc.EmbeddedDataSource40;
-import org.apache.derby.jdbc.EmbeddedXADataSource40;
 import org.apache.derby.jdbc.BasicClientDataSource40;
 import org.apache.derby.jdbc.BasicEmbeddedDataSource40;
+import org.apache.derby.jdbc.ClientConnectionPoolDataSource;
+import org.apache.derby.jdbc.ClientDataSource;
+import org.apache.derby.jdbc.ClientXADataSource;
+import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource;
+import org.apache.derby.jdbc.EmbeddedDataSource;
+import org.apache.derby.jdbc.EmbeddedXADataSource;
 import org.apache.derbyTesting.junit.JDBC;
 
 /**
@@ -47,14 +47,14 @@ public  class   Wrapper41DataSource
     //
     ///////////////////////////////////////////////////////////////////////
 
-    private EmbeddedDataSource40    _embedded;
-    private EmbeddedConnectionPoolDataSource40    _ecpds;
-    private EmbeddedXADataSource40    _exads;
+    private EmbeddedDataSource               _embedded;
+    private EmbeddedConnectionPoolDataSource _ecpds;
+    private EmbeddedXADataSource             _exads;
     private BasicEmbeddedDataSource40    _basicembedded;
 
-    private ClientDataSource40      _netclient;
-    private ClientConnectionPoolDataSource40      _ccpds;
-    private ClientXADataSource40      _cxads;
+    private ClientDataSource               _netclient;
+    private ClientConnectionPoolDataSource _ccpds;
+    private ClientXADataSource             _cxads;
     private BasicClientDataSource40      _basicnetclient;
 
 
@@ -67,18 +67,18 @@ public  class   Wrapper41DataSource
     public Wrapper41DataSource( Object wrapped ) throws Exception
     {
         if (JDBC.vmSupportsJNDI()) {
-            if ( wrapped instanceof EmbeddedDataSource40  ) {
-                _embedded = (EmbeddedDataSource40 ) wrapped; }
-            else if ( wrapped instanceof EmbeddedConnectionPoolDataSource40 ) {
-                _ecpds = (EmbeddedConnectionPoolDataSource40) wrapped; }
-            else if ( wrapped instanceof EmbeddedXADataSource40 ) {
-                _exads = (EmbeddedXADataSource40) wrapped; }
-            else if ( wrapped instanceof ClientDataSource40 ) {
-                _netclient = (ClientDataSource40) wrapped; }
-            else if ( wrapped instanceof ClientConnectionPoolDataSource40 ) {
-                _ccpds = (ClientConnectionPoolDataSource40) wrapped; }
-            else if ( wrapped instanceof ClientXADataSource40 ) {
-                _cxads = (ClientXADataSource40) wrapped; }
+            if ( wrapped instanceof EmbeddedDataSource  ) {
+                _embedded = (EmbeddedDataSource) wrapped; }
+            else if ( wrapped instanceof EmbeddedConnectionPoolDataSource ) {
+                _ecpds = (EmbeddedConnectionPoolDataSource) wrapped; }
+            else if ( wrapped instanceof EmbeddedXADataSource ) {
+                _exads = (EmbeddedXADataSource) wrapped; }
+            else if ( wrapped instanceof ClientDataSource ) {
+                _netclient = (ClientDataSource) wrapped; }
+            else if ( wrapped instanceof ClientConnectionPoolDataSource ) {
+                _ccpds = (ClientConnectionPoolDataSource) wrapped; }
+            else if ( wrapped instanceof ClientXADataSource ) {
+                _cxads = (ClientXADataSource) wrapped; }
             else { throw nothingWrapped(); }
         } else {
             if ( wrapped instanceof BasicEmbeddedDataSource40  ) {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java?rev=1489349&r1=1489348&r2=1489349&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
Tue Jun  4 09:09:36 2013
@@ -23,11 +23,9 @@ package org.apache.derbyTesting.function
 
 import java.sql.Connection;
 import java.sql.Statement;
-import java.net.Socket;
 import java.io.File;
-import java.lang.Integer;
+import org.apache.derby.jdbc.EmbeddedDataSource;
 
-import org.apache.derby.jdbc.EmbeddedDataSource40;
 /**
  * Create and boot the supplied db argument. This auxiliary program is used by
  * {@code BootLockTest.java} to boot a db in a different jvm and subsequently
@@ -48,7 +46,7 @@ public class BootLockMinion {
                            "BootLockMinion.log");
         try
         {
-            EmbeddedDataSource40 ds = new EmbeddedDataSource40();
+            EmbeddedDataSource ds = new EmbeddedDataSource();
             ds.setDatabaseName(dbName);
             ds.setCreateDatabase("create");
 

Modified: db/derby/code/trunk/java/tools/org/apache/derby/tools/SignatureChecker.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/tools/SignatureChecker.java?rev=1489349&r1=1489348&r2=1489349&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/tools/SignatureChecker.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/tools/SignatureChecker.java Tue Jun  4
09:09:36 2013
@@ -29,7 +29,6 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 
-import org.apache.derby.jdbc.EmbeddedDataSource40;
 import org.apache.derby.iapi.tools.i18n.LocalizedResource;
 
 /**
@@ -138,10 +137,7 @@ public class SignatureChecker
     private void    execute()
     {
         try {
-            Connection  conn;
-        
-            if ( _parsedArgs.isJ2ME() ) { conn = getJ2MEConnection(); }
-            else { conn = getJ2SEConnection(); }
+            Connection conn = getJ2SEConnection();
 
             if ( conn == null )
             {
@@ -427,16 +423,6 @@ public class SignatureChecker
     //
     ///////////////////////////////////////////////////////////////////////////////////
 
-    private Connection  getJ2MEConnection()
-        throws SQLException
-    {
-        EmbeddedDataSource40    dataSource = new EmbeddedDataSource40();
-
-        dataSource.setDatabaseName( _parsedArgs.getJ2meDatabaseName() );
-
-        return dataSource.getConnection();
-    }
-
     /**
      * We use reflection to get the J2SE connection so that references to
      * DriverManager will not generate linkage errors on old J2ME platforms
@@ -582,53 +568,25 @@ public class SignatureChecker
     static class ParsedArgs
     {
         private boolean _isValid;
-        private boolean _isJ2ME;
         private String _j2seConnectionUrl;
-        private String _j2meDatabaseName;
 
         public  ParsedArgs( String[] args )
         {
             _isValid = false;
-            
-            _isJ2ME = !classExists( "java.sql.DriverManager" );
-
             parseArgs( args );
         }
 
         public boolean isValid() { return _isValid; }
-        public boolean isJ2ME() { return _isJ2ME; }
 
         public String getJ2seConnectionUrl() { return _j2seConnectionUrl; }
-        public String getJ2meDatabaseName() { return _j2meDatabaseName; }
 
         private void parseArgs( String[] args )
         {
             if ( args == null ) { return; }
-            if ( args.length == 0 ) { return; }
-            
-            if ( isJ2ME() )
-            {
-                if ( args.length != 1 ) { return; }
-
-                _j2meDatabaseName = args[ 0 ];
-                _isValid = true;
-            }
-            else
-            {
-                if ( args.length != 1 ) { return; }
-
-                _j2seConnectionUrl = args[ 0 ];
-                _isValid = true;
-            }
-        }
-
-        private boolean classExists( String className )
-        {
-            try {
-                Class.forName( className );
+            if ( args.length != 1 ) { return; }
 
-                return true;
-            } catch (Throwable t) { return false; }
+            _j2seConnectionUrl = args[ 0 ];
+            _isValid = true;
         }
     }
 



Mime
View raw message