db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r392115 - in /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc: EmbedConnection.java EmbedPreparedStatement.java EmbedResultSet.java EmbedStatement.java
Date Thu, 06 Apr 2006 23:23:11 GMT
Author: djd
Date: Thu Apr  6 16:23:09 2006
New Revision: 392115

URL: http://svn.apache.org/viewcvs?rev=392115&view=rev
Log:
DERBY-1158 (partial) Some cleanup of field & method permissions in the embedded JDBC driver
and rename getWarnings to addWarning to
correctly reflect its use.
Merge of 389630 from trunk.

Modified:
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java?rev=392115&r1=392114&r2=392115&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
Thu Apr  6 16:23:09 2006
@@ -107,11 +107,14 @@
 	private boolean	active;
 	protected boolean	autoCommit = true;
 	boolean	needCommit;
-	//following is a new feature in JDBC3.0 where you can specify the holdability
-	//of a resultset at the end of the transaction. This gets set by the
-	//new method setHoldability(int) in JDBC3.0
-	protected int	connectionHoldAbility = JDBC30Translation.HOLD_CURSORS_OVER_COMMIT;
 
+	/*
+     following is a new feature in JDBC3.0 where you can specify the holdability
+     of a resultset at the end of the transaction. This gets set by the
+	 new method setHoldability(int) in JDBC3.0
+     * 
+	 */
+	private int	connectionHoldAbility = JDBC30Translation.HOLD_CURSORS_OVER_COMMIT;
 
 	//////////////////////////////////////////////////////////
 	// NESTING SPECIFIC OBJECTS

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java?rev=392115&r1=392114&r2=392115&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
Thu Apr  6 16:23:09 2006
@@ -115,8 +115,9 @@
 			SQLText = sql;
 
 			try {
+
 			    preparedStatement = lcc.prepareInternalStatement(sql);
-				getWarnings(preparedStatement.getCompileTimeWarnings());
+                addWarning(preparedStatement.getCompileTimeWarnings());
 
 			    activation = preparedStatement.getActivation(lcc, resultSetType == JDBC20Translation.TYPE_SCROLL_INSENSITIVE);
 

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java?rev=392115&r1=392114&r2=392115&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
Thu Apr  6 16:23:09 2006
@@ -104,7 +104,7 @@
 	private Object	currentStream;
 
 	// immutable state
-	protected ResultSet theResults;
+	private ResultSet theResults;
 	private boolean forMetaData;
 	private ResultSetMetaData rMetaData;
 	private SQLWarning topWarning;
@@ -159,9 +159,9 @@
      */
     private Statement applicationStmt;
     
-	protected final boolean isAtomic;
+	private final boolean isAtomic;
 
-	protected final int concurrencyOfThisResultSet;
+	private final int concurrencyOfThisResultSet;
 
 	//copyOfDatabaseRow will keep the original contents of the columns of the current row which
got updated.
 	//These will be used if user decides to cancel the changes made to the row using cancelRowUpdates.
@@ -3802,7 +3802,7 @@
 		be closed (e.g. when executing a server side Java procedure). See bug 4397
 
 	*/
-	public static final SQLException noStateChangeException(Throwable thrownException) {
+	static final SQLException noStateChangeException(Throwable thrownException) {
 
 		// Any exception on a setXXX/getXXX method does not close
 		// the ResultSet or the Statement. So we only need

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java?rev=392115&r1=392114&r2=392115&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
Thu Apr  6 16:23:09 2006
@@ -70,9 +70,9 @@
 	protected String cursorName;
 
 	protected final boolean forMetaData;
-	public final int resultSetType;
-	protected final int resultSetConcurrency;
-	protected final int resultSetHoldability;
+	final int resultSetType;
+	private final int resultSetConcurrency;
+	private final int resultSetHoldability;
 	protected final LanguageConnectionContext lcc;
 
 	private SQLWarning warnings;
@@ -767,7 +767,7 @@
      * ResultSet.CLOSE_CURSORS_AT_COMMIT
      * @exception SQLException Feature not implemented for now.
      */
-    public int getResultSetHoldability() throws SQLException {
+    public final int getResultSetHoldability() throws SQLException {
 		checkStatus();
 		return resultSetHoldability;
 	}
@@ -1083,7 +1083,7 @@
 				// gets it for us, it won't recompile unless it is invalid.
 				PreparedStatement ps = a.getPreparedStatement();
 				ps.rePrepare(lcc);
-				getWarnings(ps.getCompileTimeWarnings());
+				addWarning(ps.getCompileTimeWarnings());
 
 
 				/*
@@ -1099,6 +1099,7 @@
 				{
 					a.setCursorName(cursorName);
 				}
+
 				a.setResultSetHoldability(resultSetHoldability != JDBC30Translation.CLOSE_CURSORS_AT_COMMIT);
 
 				//reset the activation to clear warnings
@@ -1106,7 +1107,7 @@
 				a.reset();
 				a.setMaxRows(maxRows);
 				ResultSet resultsToWrap = ps.execute(a, executeQuery, executeUpdate, false);
-				getWarnings(a.getWarnings());
+				addWarning(a.getWarnings());
 
 
 				if (resultsToWrap.returnsRows()) {
@@ -1177,7 +1178,14 @@
 		}
 	}
 
-	protected void getWarnings(SQLWarning sw)
+    /**
+     * Add a SQLWarning to this Statement object.
+     * If the Statement already has a SQLWarning then it
+     * is added to the end of the chain.
+     * 
+     * @see #getWarnings()
+     */
+	final void addWarning(SQLWarning sw)
 	{
 		if (sw != null) {
 			if (warnings == null)
@@ -1366,7 +1374,7 @@
 			dynamicResults = sorted;
 
 			if (actualCount > maxDynamicResultSets) {
-				getWarnings(StandardException.newWarning(SQLState.LANG_TOO_MANY_DYNAMIC_RESULTS_RETURNED));
+				addWarning(StandardException.newWarning(SQLState.LANG_TOO_MANY_DYNAMIC_RESULTS_RETURNED));
 
 				for (int i = maxDynamicResultSets; i < actualCount; i++) {
 					sorted[i].close();



Mime
View raw message