db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r515563 - in /db/derby/code/trunk/java: client/org/apache/derby/client/net/ drda/org/apache/derby/impl/drda/
Date Wed, 07 Mar 2007 13:40:14 GMT
Author: kristwaa
Date: Wed Mar  7 05:40:14 2007
New Revision: 515563

URL: http://svn.apache.org/viewvc?view=rev&rev=515563
Log:
DERBY-2347: Add code to support request and return of locators over DRDA.

Patch contributed by Øystein Grøvlen.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/net/CodePointNameTable.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/CodePointNameTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/CodePointNameTable.java?view=diff&rev=515563&r1=515562&r2=515563
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/CodePointNameTable.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/CodePointNameTable.java Wed
Mar  7 05:40:14 2007
@@ -53,6 +53,7 @@
         put(new Integer(CodePoint.EXCSQLIMM), "EXCSQLIMM");
         put(new Integer(CodePoint.EXCSQLSTT), "EXCSQLSTT");
         put(new Integer(CodePoint.OPNQRY), "OPNQRY");
+        put(new Integer(CodePoint.OUTOVR), "OUTOVR");
         put(new Integer(CodePoint.PRPSQLSTT), "PRPSQLSTT");
         put(new Integer(CodePoint.RDBCMM), "RDBCMM");
         put(new Integer(CodePoint.RDBRLLBCK), "RDBRLLBCK");

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.java?view=diff&rev=515563&r1=515562&r2=515563
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.java Wed
Mar  7 05:40:14 2007
@@ -268,11 +268,16 @@
         updateLengthBytes(); // for cntqry
     }
 
-    private void buildOUTOVR(ResultSet resultSet,
+    private void buildOUTOVR(NetResultSet resultSet,
                              ColumnMetaData resultSetMetaData,
                              boolean firstOutovrBuilt,
                              boolean hasLobs) throws SqlException {
-        return;
+        if (false && hasLobs) {  // Disable use of locators for now
+            if (!firstOutovrBuilt) {
+                buildOUTOVR(resultSet, resultSetMetaData);
+                resultSet.firstOutovrBuilt_ = true;
+            }
+        }
     }
 
     private void buildRTNEXTDTA(int rtnextdta) throws SqlException {

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java?view=diff&rev=515563&r1=515562&r2=515563
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java Wed
Mar  7 05:40:14 2007
@@ -629,6 +629,19 @@
         int numVars = resultSetMetaData.columns_;
         int[][] lidAndLengths = new int[numVars][2]; //everything initialized to "default
triplet"
 
+        for (int i=0; i<numVars; ++i) {
+            switch (resultSetMetaData.types_[i]) {
+                case java.sql.Types.BLOB:
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBLOC;
+                    lidAndLengths[i][1] = 4;
+                    break;
+                case java.sql.Types.CLOB:
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NCLOBLOC;
+                    lidAndLengths[i][1] = 4;
+                    break;
+            }
+        }
+
         return lidAndLengths;
     }
 

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?view=diff&rev=515563&r1=515562&r2=515563
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Wed Mar 
7 05:40:14 2007
@@ -7322,6 +7322,12 @@
 				case DRDAConstants.DRDA_TYPE_NLONGVARBYTE:
 						writer.writeLDBytes((byte[]) val, index);
 					break;
+                case DRDAConstants.DRDA_TYPE_NLOBLOC:
+                case DRDAConstants.DRDA_TYPE_NCLOBLOC:
+                    // Get locator for LOB
+                    int locator = database.getConnection().addLOBMapping(val);
+                    writer.writeInt(locator);
+                    break;
 				default:
 					if (SanityManager.DEBUG) 
 						trace("ndrdaType is: "+ndrdaType);

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java?view=diff&rev=515563&r1=515562&r2=515563
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java Wed Mar  7
05:40:14 2007
@@ -246,7 +246,11 @@
 	 */
 	protected int getRsDRDAType(int index)
 	{
-		return rsDRDATypes[index -1];
+        if ((outovr_drdaType != null) && (outovr_drdaType[index-1] != 0)) {
+            // Override with requested type.  0 means use default
+            return outovr_drdaType[index-1];
+        }
+        return rsDRDATypes[index -1];
 	}
 	
 



Mime
View raw message