db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r379565 - in /db/derby/code/trunk/java/client/org/apache/derby: client/am/ client/net/ jdbc/
Date Tue, 21 Feb 2006 19:56:45 GMT
Author: djd
Date: Tue Feb 21 11:56:40 2006
New Revision: 379565

URL: http://svn.apache.org/viewcvs?rev=379565&view=rev
Log:
DERBY-446 Remove holdability constants from ClientBaseDataSource and instead use
the identical values in JDBC30Translation.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementReply.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java?rev=379565&r1=379564&r2=379565&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java Tue Feb
21 11:56:40 2006
@@ -24,7 +24,7 @@
 
 import org.apache.derby.jdbc.ClientDataSource;
 import org.apache.derby.shared.common.reference.SQLState;
-
+import org.apache.derby.shared.common.reference.JDBC30Translation;
 
 // Note:
 //   Tag members using the strictest visibility.
@@ -1282,7 +1282,7 @@
         cs.setStringX(3, "");
         cs.setStringX(4, "%");
         int cursorHold;
-        if (connection_.resultSetHoldability_ == ClientDataSource.HOLD_CURSORS_OVER_COMMIT)
{
+        if (connection_.resultSetHoldability_ == JDBC30Translation.HOLD_CURSORS_OVER_COMMIT)
{
             cursorHold = 1;
         } else {
             cursorHold = 0;
@@ -1629,7 +1629,7 @@
         cs.setStringX(6, table);
         // We're passing the keyword EXPORTEDKEY, but this support may not be in the GA version
of SPs.
         // As a workaround in getCrossReference(), we'll just "select * where 0=1" when primaryTable==""
-        if (connection_.resultSetHoldability_ == ClientDataSource.HOLD_CURSORS_OVER_COMMIT)
{
+        if (connection_.resultSetHoldability_ == JDBC30Translation.HOLD_CURSORS_OVER_COMMIT)
{
             cs.setStringX(7, "DATATYPE='JDBC';IMPORTEDKEY=1; CURSORHOLD=1");
         } else {
             cs.setStringX(7, "DATATYPE='JDBC';IMPORTEDKEY=1; CURSORHOLD=0");
@@ -1682,7 +1682,7 @@
         cs.setStringX(6, "");
         // We're passing the keyword EXPORTEDKEY, but this support may not be in the GA version
of SPs.
         // As a workaround in getCrossReference(), we'll just "select * where 0=1" when foreignTable==""
-        if (connection_.resultSetHoldability_ == ClientDataSource.HOLD_CURSORS_OVER_COMMIT)
{
+        if (connection_.resultSetHoldability_ == JDBC30Translation.HOLD_CURSORS_OVER_COMMIT)
{
             cs.setStringX(7, "DATATYPE='JDBC';EXPORTEDKEY=1; CURSORHOLD=1");
         } else {
             cs.setStringX(7, "DATATYPE='JDBC';EXPORTEDKEY=1; CURSORHOLD=0");
@@ -1911,7 +1911,7 @@
     // helper method for the catalog queries only
     private String getOptions() {
         int cursorHold;
-        if (connection_.resultSetHoldability_ == ClientDataSource.HOLD_CURSORS_OVER_COMMIT)
{
+        if (connection_.resultSetHoldability_ == JDBC30Translation.HOLD_CURSORS_OVER_COMMIT)
{
             cursorHold = 1;
         } else {
             cursorHold = 0;

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java?rev=379565&r1=379564&r2=379565&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java Tue Feb
21 11:56:40 2006
@@ -20,6 +20,8 @@
 
 package org.apache.derby.client.am;
 
+import org.apache.derby.shared.common.reference.JDBC30Translation;
+
 
 public class SectionManager {
     String collection_;
@@ -96,9 +98,9 @@
      *                             CLOSE_CURSORS_AT_COMMIT
      */
     public void setPKGNAMCBytes(byte[] b, int resultSetHoldability) {
-        if (resultSetHoldability == org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT)
{
+        if (resultSetHoldability == JDBC30Translation.HOLD_CURSORS_OVER_COMMIT) {
             agent_.sectionManager_.holdPKGNAMCBytes = b;
-        } else if (resultSetHoldability == org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT)
{
+        } else if (resultSetHoldability == JDBC30Translation.CLOSE_CURSORS_AT_COMMIT) {
             agent_.sectionManager_.noHoldPKGNAMCBytes = b;
         }
     }
@@ -109,9 +111,9 @@
     // Get a section for either a jdbc update or query statement.
     public Section getDynamicSection(int resultSetHoldability) throws SqlException {
         int cursorHoldIndex;
-        if (resultSetHoldability == org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT)
{
+        if (resultSetHoldability == JDBC30Translation.HOLD_CURSORS_OVER_COMMIT) {
             return getSection(freeSectionsHold_, packageNameWithHold__, cursorNamePrefixWithHold__,
resultSetHoldability);
-        } else if (resultSetHoldability == org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT)
{
+        } else if (resultSetHoldability == JDBC30Translation.CLOSE_CURSORS_AT_COMMIT) {
             return getSection(freeSectionsNonHold_, packageNameWithNoHold__, cursorNamePrefixWithNoHold__,
resultSetHoldability);
         } else {
             throw new SqlException(agent_.logWriter_, "resultSetHoldability property " +
resultSetHoldability + " not supported");
@@ -134,9 +136,9 @@
     }
 
     public void freeSection(Section section, int resultSetHoldability) {
-        if (resultSetHoldability == org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT)
{
+        if (resultSetHoldability == JDBC30Translation.HOLD_CURSORS_OVER_COMMIT) {
             this.freeSectionsHold_.push(section);
-        } else if (resultSetHoldability == org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT)
{
+        } else if (resultSetHoldability == JDBC30Translation.CLOSE_CURSORS_AT_COMMIT) {
             this.freeSectionsNonHold_.push(section);
         }
     }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java?rev=379565&r1=379564&r2=379565&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java Tue Feb 21 11:56:40
2006
@@ -21,6 +21,8 @@
 
 import java.sql.SQLException;
 
+import org.apache.derby.shared.common.reference.JDBC30Translation;
+
 public class Statement implements java.sql.Statement, StatementCallbackInterface, UnitOfWorkListener
{
 
     // JDBC 3 constant indicating that the current ResultSet object
@@ -333,8 +335,8 @@
         }
 
         switch (holdability) {
-        case org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT:
-        case org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT:
+        case JDBC30Translation.CLOSE_CURSORS_AT_COMMIT:
+        case JDBC30Translation.HOLD_CURSORS_OVER_COMMIT:
             resultSetHoldability_ = holdability;
             break;
         default:

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData.java?rev=379565&r1=379564&r2=379565&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData.java Tue
Feb 21 11:56:40 2006
@@ -22,6 +22,7 @@
 import org.apache.derby.client.am.Configuration;
 import org.apache.derby.client.am.ProductLevel;
 import org.apache.derby.client.am.SqlException;
+import org.apache.derby.shared.common.reference.JDBC30Translation;
 
 
 public class NetDatabaseMetaData extends org.apache.derby.client.am.DatabaseMetaData {
@@ -93,7 +94,7 @@
 
 
     public void setDefaultResultSetHoldability() {
-        connection_.resultSetHoldability_ = org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT;
+        connection_.resultSetHoldability_ = JDBC30Translation.HOLD_CURSORS_OVER_COMMIT;
     }
 
     /**

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementReply.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementReply.java?rev=379565&r1=379564&r2=379565&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementReply.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementReply.java Tue
Feb 21 11:56:40 2006
@@ -30,6 +30,7 @@
 import org.apache.derby.client.am.StatementCallbackInterface;
 import org.apache.derby.client.am.Types;
 import org.apache.derby.client.am.Utils;
+import org.apache.derby.shared.common.reference.JDBC30Translation;
 
 
 public class NetStatementReply extends NetPackageReply implements StatementReplyInterface
{
@@ -2316,9 +2317,9 @@
 
     private int calculateResultSetHoldability(int sqlcsrhld) {
         if (sqlcsrhld == 0xF0) {
-            return org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT;
+            return JDBC30Translation.CLOSE_CURSORS_AT_COMMIT;
         } else {
-            return org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT;
+            return JDBC30Translation.HOLD_CURSORS_OVER_COMMIT;
         }
     }
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java?rev=379565&r1=379564&r2=379565&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java Tue Feb
21 11:56:40 2006
@@ -161,10 +161,6 @@
         return parseString(userString, propertyDefault_user);
     }
 
-    public final static int HOLD_CURSORS_OVER_COMMIT = 1; // this matches jdbc 3 ResultSet.HOLD_CURSORS_OVER_COMMIT
-    public final static int CLOSE_CURSORS_AT_COMMIT = 2;  // this matches jdbc 3 ResultSet.CLOSE_CURSORS_AT_COMMIT
-
-
     // ---------------------------- securityMechanism -----------------------------------
     //
     // The source security mechanism to use when connecting to this data source.



Mime
View raw message