db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1205195 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/jdbc/BrokeredConnection40.java iapi/jdbc/EngineConnection40.java iapi/jdbc/build.xml impl/jdbc/EmbedConnection40.java
Date Tue, 22 Nov 2011 22:22:46 GMT
Author: kahatlen
Date: Tue Nov 22 22:22:45 2011
New Revision: 1205195

URL: http://svn.apache.org/viewvc?rev=1205195&view=rev
Log:
DERBY-4845: Improve the dependency tracking for our build targets

Remove dependency on EmbedConnection40 from BrokeredConnection40.

Added:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection40.java   (with
props)
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/build.xml
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java

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=1205195&r1=1205194&r2=1205195&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
Nov 22 22:22:45 2011
@@ -24,7 +24,6 @@ package org.apache.derby.iapi.jdbc;
 import java.sql.Array;
 import java.sql.Blob;
 import java.sql.Clob;
-import java.sql.Connection;
 import java.sql.SQLClientInfoException;
 import java.sql.NClob;
 import java.sql.SQLException;
@@ -33,12 +32,11 @@ import java.sql.Struct;
 import java.util.Properties;
 import java.util.concurrent.Executor;
 import org.apache.derby.impl.jdbc.Util;
-//import org.apache.derby.impl.jdbc.EmbedConnection40;
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.impl.jdbc.EmbedConnection40;
 
 
-public class BrokeredConnection40 extends BrokeredConnection30 {
+public class BrokeredConnection40
+        extends BrokeredConnection30 implements EngineConnection40 {
     
     /** Creates a new instance of BrokeredConnection40 */
     public BrokeredConnection40(BrokeredConnectionControl control) {
@@ -356,14 +354,15 @@ public class BrokeredConnection40 extend
     {
         if (!isClosed)
         {
-            ((EmbedConnection40) getRealConnection()).abort( executor );
+            ((EngineConnection40) getRealConnection()).abort(executor);
         }
     }
     
     public int getNetworkTimeout() throws SQLException
     {
          try {
-             return ((EmbedConnection40) getRealConnection()).getNetworkTimeout();
+             return
+                 ((EngineConnection40) getRealConnection()).getNetworkTimeout();
          } catch (SQLException sqle) {
              notifyException(sqle);
              throw sqle;
@@ -373,7 +372,8 @@ public class BrokeredConnection40 extend
     public void setNetworkTimeout( Executor executor, int milliseconds ) throws SQLException
     {
          try {
-             ((EmbedConnection40) getRealConnection()).setNetworkTimeout( executor, milliseconds
);
+             ((EngineConnection40) getRealConnection())
+                     .setNetworkTimeout(executor, milliseconds);
          } catch (SQLException sqle) {
              notifyException(sqle);
              throw sqle;

Added: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection40.java?rev=1205195&view=auto
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection40.java (added)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection40.java Tue
Nov 22 22:22:45 2011
@@ -0,0 +1,46 @@
+/*
+
+   Derby - Class org.apache.derby.iapi.jdbc.EngineConnection40
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to you under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+package org.apache.derby.iapi.jdbc;
+
+import java.sql.SQLException;
+import java.util.concurrent.Executor;
+
+/**
+ * <p>
+ * Additional methods exposed on the Connection object for interaction between
+ * EmbedConnection and BrokeredConnection. These methods should generally go
+ * into the EngineConnection interface, but those that have signatures that are
+ * not compatible with all platforms on which EngineConnection needs to work,
+ * could go into this interface.
+ * </p>
+ *
+ * <p>
+ * For example, the JDBC 4.1 methods that take a java.util.concurrent.Executor
+ * argument, cannot be included in an interface that should be loadable on CDC,
+ * and they must go here.
+ * </p>
+ */
+public interface EngineConnection40 extends EngineConnection {
+    // JDBC 4.1 methods that take an Executor argument
+    void abort(Executor executor) throws SQLException;
+    void setNetworkTimeout(Executor executor, int millis) throws SQLException;
+    int getNetworkTimeout() throws SQLException;
+}

Propchange: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineConnection40.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/build.xml?rev=1205195&r1=1205194&r2=1205195&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/build.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/build.xml Tue Nov 22 22:22:45
2011
@@ -68,6 +68,7 @@
 	  <exclude name="${derby.dir}/${cur.dir}/BrokeredCallableStatement40.java"/>
 	  <exclude name="${derby.dir}/${cur.dir}/BrokeredStatement.java"/>
       <exclude name="${derby.dir}/${cur.dir}/BrokeredStatement40.java"/>
+      <exclude name="${derby.dir}/${cur.dir}/EngineConnection40.java"/>
       <exclude name="${derby.dir}/${cur.dir}/FailedProperties40.java"/>
       <exclude name="${derby.dir}/${cur.dir}/ResourceAdapter.java"/>
     </javac>
@@ -163,6 +164,7 @@
           <include name="${derby.dir}/${cur.dir}/BrokeredStatement40.java"/>
           <include name="${derby.dir}/${cur.dir}/BrokeredPreparedStatement40.java"/>
           <include name="${derby.dir}/${cur.dir}/BrokeredCallableStatement40.java"/>
+          <include name="${derby.dir}/${cur.dir}/EngineConnection40.java"/>
           <include name="${derby.dir}/${cur.dir}/FailedProperties40.java"/>
       </javac>
   </target> 

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=1205195&r1=1205194&r2=1205195&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
Nov 22 22:22:45 2011
@@ -34,9 +34,11 @@ import java.util.concurrent.Executor;
 import org.apache.derby.jdbc.InternalDriver;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.jdbc.EngineConnection40;
 import org.apache.derby.iapi.jdbc.FailedProperties40;
 
-public class EmbedConnection40 extends EmbedConnection30 {
+public class EmbedConnection40
+        extends EmbedConnection30 implements EngineConnection40 {
     
     /** Creates a new instance of EmbedConnection40 */
     public EmbedConnection40(EmbedConnection inputConnection) {



Mime
View raw message