db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r642711 - in /db/derby/code/branches/10.4/java: drda/org/apache/derby/impl/drda/ engine/org/apache/derby/iapi/jdbc/ engine/org/apache/derby/impl/jdbc/
Date Sun, 30 Mar 2008 11:15:13 GMT
Author: kristwaa
Date: Sun Mar 30 04:15:12 2008
New Revision: 642711

URL: http://svn.apache.org/viewvc?rev=642711&view=rev
Log:
DERBY-3576: Merge EngineBlob and EngineClob into a single interface.
Merged change from trunk revision 642707 (derby-3576-1b-enginelob_interface.diff).

Added:
    db/derby/code/branches/10.4/java/engine/org/apache/derby/iapi/jdbc/EngineLOB.java
      - copied unchanged from r642707, db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineLOB.java
Removed:
    db/derby/code/branches/10.4/java/engine/org/apache/derby/iapi/jdbc/EngineBlob.java
    db/derby/code/branches/10.4/java/engine/org/apache/derby/iapi/jdbc/EngineClob.java
Modified:
    db/derby/code/branches/10.4/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
    db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
    db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
    db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java

Modified: db/derby/code/branches/10.4/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=642711&r1=642710&r2=642711&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/branches/10.4/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Sun
Mar 30 04:15:12 2008
@@ -57,8 +57,7 @@
 import org.apache.derby.iapi.services.stream.HeaderPrintWriter;
 import org.apache.derby.iapi.tools.i18n.LocalizedResource;
 import org.apache.derby.iapi.jdbc.AuthenticationService;
-import org.apache.derby.iapi.jdbc.EngineBlob;
-import org.apache.derby.iapi.jdbc.EngineClob;
+import org.apache.derby.iapi.jdbc.EngineLOB;
 import org.apache.derby.iapi.jdbc.EngineResultSet;
 import org.apache.derby.impl.jdbc.EmbedSQLException;
 import org.apache.derby.impl.jdbc.Util;
@@ -7574,10 +7573,8 @@
 						writer.writeLDBytes((byte[]) val, index);
 					break;
 				case DRDAConstants.DRDA_TYPE_NLOBLOC:
-					writer.writeInt(((EngineBlob) val).getLocator());
-					break;
 				case DRDAConstants.DRDA_TYPE_NCLOBLOC:
-					writer.writeInt(((EngineClob) val).getLocator());
+					writer.writeInt(((EngineLOB)val).getLocator());
 					break;
 				default:
 					if (SanityManager.DEBUG) 

Modified: db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java?rev=642711&r1=642710&r2=642711&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java (original)
+++ db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java Sun
Mar 30 04:15:12 2008
@@ -24,7 +24,7 @@
 
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.jdbc.EngineBlob;
+import org.apache.derby.iapi.jdbc.EngineLOB;
 import org.apache.derby.iapi.services.monitor.Monitor;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.types.DataValueDescriptor;
@@ -68,7 +68,7 @@
 
  */
 
-final class EmbedBlob extends ConnectionChild implements Blob, EngineBlob
+final class EmbedBlob extends ConnectionChild implements Blob, EngineLOB
 {
     // blob is either materialized or still in stream
     private boolean         materialized;

Modified: db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java?rev=642711&r1=642710&r2=642711&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java (original)
+++ db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java Sun
Mar 30 04:15:12 2008
@@ -24,7 +24,7 @@
 
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.jdbc.EngineClob;
+import org.apache.derby.iapi.jdbc.EngineLOB;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.types.DataValueDescriptor;
 import org.apache.derby.iapi.types.Resetable;
@@ -67,7 +67,7 @@
         new update methods can safely be added into implementation.
    </UL>
  */
-final class EmbedClob extends ConnectionChild implements Clob, EngineClob
+final class EmbedClob extends ConnectionChild implements Clob, EngineLOB
 {
 
     /**

Modified: db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java?rev=642711&r1=642710&r2=642711&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
(original)
+++ db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
Sun Mar 30 04:15:12 2008
@@ -69,6 +69,7 @@
 import java.util.Properties;
 import java.util.Iterator;
 
+import org.apache.derby.iapi.jdbc.EngineLOB;
 import org.apache.derby.impl.jdbc.authentication.NoneAuthenticationServiceImpl;
 
 /**
@@ -2869,15 +2870,9 @@
 		//the hash table object to null.
 		HashMap map = rootConnection.lobHashMap;
 		if (map != null) {
-			for (Iterator it = map.values().iterator(); it.hasNext(); ) {
-				Object obj = it.next();
-				if (obj instanceof EmbedClob) {
-					((EmbedClob) obj).free();
-				} else if (obj instanceof EmbedBlob) {
-					((EmbedBlob) obj).free();
-				} else if (SanityManager.DEBUG) {
-					SanityManager.THROWASSERT("Unexpected value: " + obj);
-				}
+            Iterator it = map.values().iterator();
+            while (it.hasNext()) {
+                ((EngineLOB)it.next()).free();
 			}
 			map.clear();
 		}

Modified: db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java?rev=642711&r1=642710&r2=642711&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
(original)
+++ db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
Sun Mar 30 04:15:12 2008
@@ -26,8 +26,7 @@
 import java.sql.DriverManager;
 import java.sql.SQLException;
 
-import org.apache.derby.iapi.jdbc.EngineBlob;
-import org.apache.derby.iapi.jdbc.EngineClob;
+import org.apache.derby.iapi.jdbc.EngineLOB;
 import org.apache.derby.iapi.reference.SQLState;
 
 /**
@@ -43,7 +42,7 @@
      * @throws SQLException
      */
     public static int CLOBCREATELOCATOR() throws SQLException {
-        EngineClob clob = (EngineClob) getEmbedConnection().createClob();
+        EngineLOB clob = (EngineLOB)getEmbedConnection().createClob();
         return clob.getLocator();
     }
 
@@ -203,7 +202,7 @@
      * @throws SQLException
      */
     public static int BLOBCREATELOCATOR() throws SQLException {
-        EngineBlob blob = (EngineBlob) getEmbedConnection().createBlob();
+        EngineLOB blob = (EngineLOB)getEmbedConnection().createBlob();
         return blob.getLocator();
     }
 



Mime
View raw message