db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r487788 [2/2] - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ client/org/apache/derby/client/net/ drda/org/apache/derby/impl/drda/ engine/org/apache/derby/iapi/jdbc/ engine/org/apache/derby/loc/ shared/org/apache/derby/sh...
Date Sat, 16 Dec 2006 11:16:06 GMT
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java?view=diff&rev=487788&r1=487787&r2=487788
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java
Sat Dec 16 03:16:04 2006
@@ -500,6 +500,30 @@
     {
         getPreparedStatement().setTimestamp( i, x, cal);
     }
+    
+    
+    public void setBinaryStream(int parameterIndex, 
+                                InputStream x)
+        throws SQLException {
+        
+        final EnginePreparedStatement engnps = 
+            (EnginePreparedStatement) getPreparedStatement();  
+
+        engnps.setBinaryStream(parameterIndex, x);
+
+    }
+    
+    
+    public void setCharacterStream(int parameterIndex, 
+                                   Reader reader)
+        throws SQLException{
+        
+        final EnginePreparedStatement engnps = 
+            (EnginePreparedStatement) getPreparedStatement();  
+
+        engnps.setCharacterStream(parameterIndex, reader);
+        
+    }
 
 	/*
 	** Control methods.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement40.java?view=diff&rev=487788&r1=487787&r2=487788
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement40.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement40.java
Sat Dec 16 03:16:04 2006
@@ -160,20 +160,8 @@
     throws SQLException {
         getPreparedStatement().setAsciiStream(parameterIndex,x,length);
     }
-
-    /**
-     * Sets the designated parameter to the given input stream.
-     *
-     * @param parameterIndex the first parameter is 1, the second is 2, ...
-     * @param x the java input stream which contains the binary parameter value
-     * @throws SQLException if a database access error occurs or this method is
-     *      called on a closed <code>PreparedStatement</code>
-     */
-    public final void setBinaryStream(int parameterIndex, InputStream x)
-            throws SQLException {
-        getPreparedStatement().setBinaryStream(parameterIndex, x);
-    }
-
+    
+    
     /**
      * Sets the designated parameter to the given input stream, which will have
      * the specified number of bytes.
@@ -205,21 +193,8 @@
             throws SQLException {
         getPreparedStatement().setBlob(parameterIndex, inputStream);
     }
-
-    /**
-     * Sets the designated parameter to the given <code>Reader</code> object.
-     *
-     * @param parameterIndex the first parameter is 1, the second is 2, ...
-     * @param reader the <code>java.io.Reader</code> object that contains the
-     *      Unicode data
-     * @throws SQLException if a database access error occurs or this method is
-     *      called on a closed <code>PreparedStatement</code>
-     */
-    public final void setCharacterStream(int parameterIndex, Reader reader)
-            throws SQLException {
-        getPreparedStatement().setCharacterStream(parameterIndex, reader);
-    }
-
+    
+    
     /**
      * Sets the designated parameter to the given Reader, which will have
      * the specified number of bytes.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java?view=diff&rev=487788&r1=487787&r2=487788
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java
Sat Dec 16 03:16:04 2006
@@ -20,6 +20,8 @@
  */
 package org.apache.derby.iapi.jdbc;
 
+import java.io.InputStream;
+import java.io.Reader;
 import java.sql.SQLException;
 import java.sql.PreparedStatement;
 
@@ -47,4 +49,9 @@
     public EngineParameterMetaData getEmbedParameterSetMetaData()
         throws SQLException;
     
+    public void setBinaryStream(int parameterIndex, InputStream x)
+        throws SQLException; 
+    
+    public void setCharacterStream(int parameterIndex, Reader reader)
+        throws SQLException;
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml?view=diff&rev=487788&r1=487787&r2=487788
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml Sat Dec 16 03:16:04
2006
@@ -4396,6 +4396,11 @@
                 <name>XJ215.S</name>
                 <text>You cannot invoke other java.sql.Clob/java.sql.Blob methods after
calling the free() method.</text>
             </msg>
+	    
+	    <msg>
+                <name>XJ216.S</name>
+                <text>The length of this BLOB/CLOB is not available yet. When a BLOB
or CLOB is accessed as a stream, the length is not available until the entire stream has been
processed.</text>
+            </msg>
 
         </family>
 

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?view=diff&rev=487788&r1=487787&r2=487788
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
(original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Sat Dec 16 03:16:04 2006
@@ -1493,6 +1493,7 @@
     String TRACELEVEL_FORMAT_INVALID = "XJ213.C";
     String IO_ERROR_UPON_LOB_FREE = "XJ214.S";
     String LOB_OBJECT_INVALID = "XJ215.S";
+    String LOB_OBJECT_LENGTH_UNKNOWN_YET = "XJ216.S";
     
     //XN - Network-level messages
     String NET_CONNECTION_RESET_NOT_ALLOWED_IN_UNIT_OF_WORK         = "XN001.S";

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java?view=diff&rev=487788&r1=487787&r2=487788
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java
Sat Dec 16 03:16:04 2006
@@ -848,7 +848,8 @@
         try {
             setBinaryStreamOnBlob(key, length, -1, 0, true);
         } catch (SQLException sqle) {
-            if (usingEmbedded()) {
+            if (usingEmbedded() || 
+                usingDerbyNetClient() ) {
                 assertSQLState("XSDA4", sqle);
             } else {
                 assertSQLState("22001", sqle);
@@ -994,10 +995,13 @@
         try {
             setAsciiStream(psInsertClob, key, length, -1, 0, true);
         } catch (SQLException sqle) {
-            if (usingEmbedded()) {
+            if (usingEmbedded() || 
+                usingDerbyNetClient() ){
                 assertSQLState("XSDA4", sqle);
+                
             } else {
                 assertSQLState("22001", sqle);
+                
             }
         }
     }
@@ -1015,10 +1019,15 @@
             setAsciiStream(psInsertLongVarchar, key, length, -1, 0, true);
             fail("Inserted a LONG VARCHAR that is too long");
         } catch (SQLException sqle) {
-            if (usingEmbedded()) {
+            if (usingEmbedded()){
                 assertInternalDerbyIOExceptionState("XCL30", "22001", sqle);
+                
+            } else if ( usingDerbyNetClient() ) {
+                assertSQLState("XCL30", sqle);
+                
             } else {
                 assertSQLState("22001", sqle);
+                
             }
         }
     }
@@ -1031,10 +1040,15 @@
                     trailingBlanks, true);
             fail("Truncation is not allowed for LONG VARCHAR");
         } catch (SQLException sqle) {
-            if (usingEmbedded()) {
+            if (usingEmbedded()){
                 assertInternalDerbyIOExceptionState("XCL30", "22001", sqle);
+                
+            } else if( usingDerbyNetClient() ) {
+                assertSQLState("XCL30", sqle);
+                
             } else {
                 assertSQLState("22001", sqle);
+                
             }
         }
     }



Mime
View raw message