db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r544084 - /db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
Date Mon, 04 Jun 2007 08:00:46 GMT
Author: kahatlen
Date: Mon Jun  4 01:00:45 2007
New Revision: 544084

URL: http://svn.apache.org/viewvc?view=rev&rev=544084
Log:
DERBY-2587: Implement support for returning locator-enabled CLOBs from
Connection.createClob() in the network client. The new code is
currently disabled.

Contributed by V. Narayanan.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java?view=diff&rev=544084&r1=544083&r2=544084
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java Mon Jun  4
01:00:45 2007
@@ -2166,9 +2166,39 @@
         } catch (SqlException se) {
             throw se.getSQLException();
         }
-        org.apache.derby.client.am.Clob clob = new 
-                org.apache.derby.client.am.Clob(this.agent_,"");
         
+        //Stores a locator value obtained by calling the
+        //stored procedure CLOBCREATELOCATOR.
+        int locator = INVALID_LOCATOR;
+
+        //Stores the Clob instance that is returned.
+        org.apache.derby.client.am.Clob clob = null;
+
+        //Call the CLOBCREATELOCATOR stored procedure
+        //that will return a locator value.
+        try {
+            locator = locatorProcedureCall().clobCreateLocator();
+        }
+        catch(SqlException sqle) {
+            throw sqle.getSQLException();
+        }
+
+        //If the locator value is -1 it means that we do not
+        //have locator support on the server.
+
+        //The code here has been disabled because the Lob implementations
+        //have still not been completely converted to use locators. Once
+        //the Lob implementations are completed then this code can be enabled.
+        if (locator != INVALID_LOCATOR && false) {
+            //A valid locator value has been obtained.
+            clob = new org.apache.derby.client.am.Clob(this.agent_, locator);
+        }
+        else {
+            //A valid locator value could not be obtained.
+            clob = new org.apache.derby.client.am.Clob
+                    (this.agent_, "");
+        }
+
         if (agent_.loggingEnabled()) {
             agent_.logWriter_.traceExit(this, "createClob", clob);
         }



Mime
View raw message