db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r632414 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ engine/org/apache/derby/impl/jdbc/ shared/org/apache/derby/shared/common/reference/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/
Date Fri, 29 Feb 2008 19:24:34 GMT
Author: djd
Date: Fri Feb 29 11:24:13 2008
New Revision: 632414

URL: http://svn.apache.org/viewvc?rev=632414&view=rev
Log:
DERBY-3484 For JDBC 3.0 java.sql.Statement constants use directly instead of through JDBC30Translation
as JSR169 supports all the types

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/JDBC30Translation.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc30Test.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java?rev=632414&r1=632413&r2=632414&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java Fri Feb 29
11:24:13 2008
@@ -703,7 +703,7 @@
 			}
 			// For normal selects we are done, but procedures might
 			// have more resultSets
-		}while (isCallable && getMoreResults(JDBC30Translation.KEEP_CURRENT_RESULT));
+		}while (isCallable && getMoreResults(Statement.KEEP_CURRENT_RESULT));
 
 		return hasResultSet;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java?rev=632414&r1=632413&r2=632414&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
Fri Feb 29 11:24:13 2008
@@ -37,6 +37,7 @@
 import java.sql.Clob;
 import java.sql.SQLException;
 import java.sql.Date;
+import java.sql.Statement;
 import java.sql.Time;
 import java.sql.Timestamp;
 import java.util.Calendar;
@@ -69,7 +70,7 @@
 			  resultSetType,
 			  resultSetConcurrency,
 			  resultSetHoldability,
-			  JDBC30Translation.NO_GENERATED_KEYS,
+			  Statement.NO_GENERATED_KEYS,
 			  null,
 			  null);
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java?rev=632414&r1=632413&r2=632414&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java Fri Feb
29 11:24:13 2008
@@ -1201,7 +1201,7 @@
 		return prepareStatement(sql,JDBC20Translation.TYPE_FORWARD_ONLY,
 			JDBC20Translation.CONCUR_READ_ONLY,
 			connectionHoldAbility,
-			JDBC30Translation.NO_GENERATED_KEYS,
+			Statement.NO_GENERATED_KEYS,
 			null,
 			null);
 	}
@@ -1227,7 +1227,7 @@
 			resultSetType,
 			resultSetConcurrency,
 			connectionHoldAbility,
-			JDBC30Translation.NO_GENERATED_KEYS,
+			Statement.NO_GENERATED_KEYS,
 			null,
 			null);
 	}
@@ -1255,7 +1255,7 @@
 			resultSetType,
 			resultSetConcurrency,
 			resultSetHoldability,
-			JDBC30Translation.NO_GENERATED_KEYS,
+			Statement.NO_GENERATED_KEYS,
 			null,
 			null);
 	}
@@ -1291,8 +1291,8 @@
 			JDBC20Translation.CONCUR_READ_ONLY,
 			connectionHoldAbility,
 			(columnIndexes == null || columnIndexes.length == 0)
-				? JDBC30Translation.NO_GENERATED_KEYS
-				: JDBC30Translation.RETURN_GENERATED_KEYS,
+				? Statement.NO_GENERATED_KEYS
+				: Statement.RETURN_GENERATED_KEYS,
 			columnIndexes,
 			null);
 	}
@@ -1326,8 +1326,8 @@
 			JDBC20Translation.CONCUR_READ_ONLY,
 			connectionHoldAbility,
 			(columnNames == null || columnNames.length == 0)
-				? JDBC30Translation.NO_GENERATED_KEYS
-				: JDBC30Translation.RETURN_GENERATED_KEYS,
+				? Statement.NO_GENERATED_KEYS
+				: Statement.RETURN_GENERATED_KEYS,
 			null,
 			columnNames);
 	}
@@ -2376,7 +2376,7 @@
 											  JDBC20Translation.TYPE_FORWARD_ONLY,
 											  JDBC20Translation.CONCUR_READ_ONLY,
 											  connectionHoldAbility,
-											  JDBC30Translation.NO_GENERATED_KEYS,
+											  Statement.NO_GENERATED_KEYS,
 											  null,
 											  null);
 			} finally {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java?rev=632414&r1=632413&r2=632414&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
Fri Feb 29 11:24:13 2008
@@ -44,7 +44,6 @@
 
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.reference.JDBC40Translation;
-import org.apache.derby.iapi.reference.JDBC30Translation;
 import org.apache.derby.iapi.reference.JDBC20Translation;
 
 import java.util.Calendar;
@@ -58,6 +57,7 @@
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.sql.Date;
+import java.sql.Statement;
 import java.sql.Time;
 import java.sql.Timestamp;
 import java.sql.Clob;
@@ -137,7 +137,7 @@
 
 			//bug 4838 - save the auto-generated key information in activation. keeping this
 			//information in lcc will not work work as it can be tampered by a nested trasaction
-  				if (autoGeneratedKeys == JDBC30Translation.RETURN_GENERATED_KEYS)
+  				if (autoGeneratedKeys == Statement.RETURN_GENERATED_KEYS)
   					activation.setAutoGeneratedKeysResultsetInfo(columnIndexes, columnNames);
 
 			} catch (Throwable t) {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java?rev=632414&r1=632413&r2=632414&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java Fri Feb
29 11:24:13 2008
@@ -37,6 +37,7 @@
 
 import java.sql.SQLException;
 import java.sql.SQLWarning;
+import java.sql.Statement;
 import java.util.Vector;
 
 /*
@@ -150,7 +151,7 @@
 	public java.sql.ResultSet executeQuery(String sql)
 		throws SQLException
 	{
-		execute(sql, true, false, JDBC30Translation.NO_GENERATED_KEYS, null, null);
+		execute(sql, true, false, Statement.NO_GENERATED_KEYS, null, null);
 
 		if (SanityManager.DEBUG) {
 			if (results == null)
@@ -173,7 +174,7 @@
      */
 	public int executeUpdate(String sql) throws SQLException
 	{
-		execute(sql, false, true, JDBC30Translation.NO_GENERATED_KEYS, null, null);
+		execute(sql, false, true, Statement.NO_GENERATED_KEYS, null, null);
 		return updateCount;
 	}
 
@@ -219,8 +220,8 @@
 	{
 		execute(sql, false, true,
 			((columnIndexes == null) || (columnIndexes.length == 0))
-				? JDBC30Translation.NO_GENERATED_KEYS
-				: JDBC30Translation.RETURN_GENERATED_KEYS,
+				? Statement.NO_GENERATED_KEYS
+				: Statement.RETURN_GENERATED_KEYS,
 			columnIndexes,
 			null);
 		return updateCount;
@@ -246,8 +247,8 @@
 	{
 		execute(sql, false, true,
 			((columnNames == null) || (columnNames.length == 0))
-				? JDBC30Translation.NO_GENERATED_KEYS
-				: JDBC30Translation.RETURN_GENERATED_KEYS,
+				? Statement.NO_GENERATED_KEYS
+				: Statement.RETURN_GENERATED_KEYS,
 			null,
 			columnNames);
 		return updateCount;
@@ -553,7 +554,7 @@
 	public boolean execute(String sql)
 		throws SQLException
 	{
-		return execute(sql, false, false, JDBC30Translation.NO_GENERATED_KEYS, null, null);
+		return execute(sql, false, false, Statement.NO_GENERATED_KEYS, null, null);
 	}
 	
     /**
@@ -619,7 +620,7 @@
 
 			//bug 4838 - save the auto-generated key information in activation. keeping this
 			//information in lcc will not work work it can be tampered by a nested trasaction
-			if (autoGeneratedKeys == JDBC30Translation.RETURN_GENERATED_KEYS)
+			if (autoGeneratedKeys == Statement.RETURN_GENERATED_KEYS)
 				activation.setAutoGeneratedKeysResultsetInfo(columnIndexes, columnNames);
 			return executeStatement(activation, executeQuery, executeUpdate);
 		} finally {
@@ -673,8 +674,8 @@
 	{
 		return execute(sql, false, true,
 			((columnIndexes == null) || (columnIndexes.length == 0))
-				? JDBC30Translation.NO_GENERATED_KEYS
-				: JDBC30Translation.RETURN_GENERATED_KEYS,
+				? Statement.NO_GENERATED_KEYS
+				: Statement.RETURN_GENERATED_KEYS,
 			columnIndexes,
 			null);
 	}
@@ -702,8 +703,8 @@
 	{
 		return execute(sql, false, true,
 			((columnNames == null) || (columnNames.length == 0))
-				? JDBC30Translation.NO_GENERATED_KEYS
-				: JDBC30Translation.RETURN_GENERATED_KEYS,
+				? Statement.NO_GENERATED_KEYS
+				: Statement.RETURN_GENERATED_KEYS,
 			null,
 			columnNames);
 	}
@@ -756,7 +757,7 @@
 	 * @exception SQLException thrown on failure.
      */
 	public final boolean getMoreResults() throws SQLException	{
-		return getMoreResults(JDBC30Translation.CLOSE_ALL_RESULTS);
+		return getMoreResults(Statement.CLOSE_ALL_RESULTS);
 	}
 
 	/////////////////////////////////////////////////////////////////////////
@@ -1009,7 +1010,7 @@
 		Execute a single element of the batch. Overridden by EmbedPreparedStatement
 	*/
 	boolean executeBatchElement(Object batchElement) throws SQLException, StandardException
{
-		return execute((String)batchElement, false, true, JDBC30Translation.NO_GENERATED_KEYS,
null, null);
+		return execute((String)batchElement, false, true, Statement.NO_GENERATED_KEYS, null, null);
 	}
 
     /**
@@ -1060,14 +1061,14 @@
 			int startingClose;
 			switch (current) {
 			default:
-			case JDBC30Translation.CLOSE_ALL_RESULTS:
+			case Statement.CLOSE_ALL_RESULTS:
 				startingClose = 0;
 				break;
-			case JDBC30Translation.CLOSE_CURRENT_RESULT:
+			case Statement.CLOSE_CURRENT_RESULT:
 				// just close the current result set.
 				startingClose = currentDynamicResultSet;
 				break;
-			case JDBC30Translation.KEEP_CURRENT_RESULT:
+			case Statement.KEEP_CURRENT_RESULT:
 				// make the close loop a no-op.
 				startingClose = dynamicResults.length;
 				break;
@@ -1136,7 +1137,7 @@
 		if (autoGeneratedKeysResultSet == null)
 			return null;
 		else {
-			execute("VALUES IDENTITY_VAL_LOCAL()", true, false, JDBC30Translation.NO_GENERATED_KEYS,
null, null);
+			execute("VALUES IDENTITY_VAL_LOCAL()", true, false, Statement.NO_GENERATED_KEYS, null,
null);
 			return results;
 		}
 	}

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/JDBC30Translation.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/JDBC30Translation.java?rev=632414&r1=632413&r2=632414&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/JDBC30Translation.java
(original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/JDBC30Translation.java
Fri Feb 29 11:24:13 2008
@@ -22,7 +22,6 @@
 package org.apache.derby.shared.common.reference;
 import java.sql.ParameterMetaData;
 import java.sql.ResultSet;
-import java.sql.Statement;
 /**
         This class contains public statics that map directly
         to the new public statics in the jdbc 3.0 classes.
@@ -57,15 +56,4 @@
         */
         public static final int HOLD_CURSORS_OVER_COMMIT = ResultSet.HOLD_CURSORS_OVER_COMMIT;
         public static final int CLOSE_CURSORS_AT_COMMIT = ResultSet.CLOSE_CURSORS_AT_COMMIT;
-
-        /*
-        ** public statics from 3.0 version of java.sql.Statement
-        */
-        public static final int CLOSE_CURRENT_RESULT = Statement.CLOSE_CURRENT_RESULT;
-        public static final int KEEP_CURRENT_RESULT = Statement.KEEP_CURRENT_RESULT;
-        public static final int CLOSE_ALL_RESULTS = Statement.CLOSE_ALL_RESULTS;
-        public static final int SUCCESS_NO_INFO = Statement.SUCCESS_NO_INFO;
-        public static final int EXECUTE_FAILED = Statement.EXECUTE_FAILED;
-        public static final int RETURN_GENERATED_KEYS = Statement.RETURN_GENERATED_KEYS;
-        public static final int NO_GENERATED_KEYS = Statement.NO_GENERATED_KEYS;
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc30Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc30Test.java?rev=632414&r1=632413&r2=632414&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc30Test.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc30Test.java
Fri Feb 29 11:24:13 2008
@@ -28,7 +28,6 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.apache.derby.iapi.reference.JDBC30Translation;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
@@ -129,7 +128,7 @@
     public void testGetMoreResults() throws SQLException {
 
         Statement stmt = createStatement();
-        assertFalse(stmt.getMoreResults(JDBC30Translation.CLOSE_CURRENT_RESULT));
+        assertFalse(stmt.getMoreResults(Statement.CLOSE_CURRENT_RESULT));
 
     }
 
@@ -143,7 +142,7 @@
 
         Statement stmt = createStatement();
         stmt.executeUpdate("insert into tab1 values(2, 3, 4.1)",
-                JDBC30Translation.NO_GENERATED_KEYS);
+                Statement.NO_GENERATED_KEYS);
         assertNull("Expected NULL ResultSet after stmt.execute()", stmt
                 .getGeneratedKeys());
 
@@ -202,7 +201,7 @@
     public void testSelectNoGenKeys() throws SQLException {
 
         Statement stmt = createStatement();
-        stmt.execute("select * from tab1", JDBC30Translation.NO_GENERATED_KEYS);
+        stmt.execute("select * from tab1", Statement.NO_GENERATED_KEYS);
         assertNull("Expected NULL ResultSet after stmt.execute()", stmt
                 .getGeneratedKeys());
 



Mime
View raw message