db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r423807 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/jdbc/ testing/org/apache/derbyTesting/functionTests/tests/jdbc4/
Date Thu, 20 Jul 2006 06:48:31 GMT
Author: kahatlen
Date: Wed Jul 19 23:48:31 2006
New Revision: 423807

URL: http://svn.apache.org/viewvc?rev=423807&view=rev
Log:
DERBY-1417 (partial) Add new, lengthless overloads to the streaming api

Add the new overloads to the Brokered* classes and update
UnsupportedVetter with the methods we support.

Patch contributed by Kristian Waagan.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java?rev=423807&r1=423806&r2=423807&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java
Wed Jul 19 23:48:31 2006
@@ -93,7 +93,12 @@
     throws SQLException{
         getCallableStatement().setNString(parameterName,value);
     }
-    
+
+    public final void setNCharacterStream(String parameterName, Reader value)
+            throws SQLException {
+        getCallableStatement().setNCharacterStream(parameterName, value);
+    }
+
     public void setNCharacterStream(String parameterName,Reader value,long length)
     throws SQLException{
         getCallableStatement().setNCharacterStream(parameterName,value,length);
@@ -102,17 +107,32 @@
     public void setNClob(String parameterName, NClob value) throws SQLException{
         getCallableStatement().setNClob(parameterName,value);
     }
-    
+
+    public final void setClob(String parameterName, Reader reader)
+            throws SQLException {
+        getCallableStatement().setClob(parameterName, reader);
+    }
+
     public void setClob(String parameterName, Reader reader, long length)
     throws SQLException{
         getCallableStatement().setClob(parameterName,reader,length);
     }
-    
+
+    public final void setBlob(String parameterName, InputStream inputStream)
+            throws SQLException {
+        getCallableStatement().setBlob(parameterName, inputStream);
+    }
+
     public void setBlob(String parameterName, InputStream inputStream, long length)
     throws SQLException{
         getCallableStatement().setBlob(parameterName,inputStream,length);
     }
-    
+
+    public final void setNClob(String parameterName, Reader reader)
+            throws SQLException {
+        getCallableStatement().setNClob(parameterName, reader);
+    }
+
     public void setNClob(String parameterName, Reader reader, long length)
     throws SQLException{
         getCallableStatement().setNClob(parameterName,reader,length);
@@ -141,6 +161,47 @@
     /************************************************************************
      *PreparedStatement40 methods
      *************************************************************************/
+
+    /**
+     * 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 that contains the ASCII parameter value
+     * @throws SQLException if a database access error occurs or this method is
+     *      called on a closed <code>PreparedStatement</code>
+     */
+    public final void setAsciiStream(int parameterIndex, InputStream x)
+            throws SQLException {
+        getCallableStatement().setAsciiStream(parameterIndex, x);
+    }
+
+    /**
+     * 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 {
+        getCallableStatement().setBinaryStream(parameterIndex, x);
+    }
+
+    /**
+     * 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 {
+        getCallableStatement().setCharacterStream(parameterIndex, reader);
+    }
+
     public void setRowId(int parameterIndex, RowId x) throws SQLException{
         getPreparedStatement().setRowId(parameterIndex,x);
     }
@@ -148,7 +209,12 @@
     public void setNString(int index, String value) throws SQLException{
         getPreparedStatement().setNString(index,value);
     }
-    
+
+    public void setNCharacterStream(int parameterIndex, Reader value)
+            throws SQLException {
+        getCallableStatement().setNCharacterStream(parameterIndex, value);
+    }
+
     public void setNCharacterStream(int index, Reader value, long length) throws SQLException{
         getPreparedStatement().setNCharacterStream(index,value,length);
     }
@@ -156,16 +222,55 @@
     public void setNClob(int index, NClob value) throws SQLException{
         getPreparedStatement().setNClob(index,value);
     }
-    
+
+    /**
+     * Sets the designated parameter to a <code>Reader</code> object.
+     * This method differs from the <code>setCharacterStream(int,Reader)</code>
+     * method because it informs the driver that the parameter value should be
+     * sent to the server as a <code>CLOB</code>.
+     *
+     * @param parameterIndex the first parameter is 1, the second is 2, ...
+     * @param reader an object that contains the data to set the parameter
+     *      value to.
+     * @throws SQLException if a database access error occurs, this method is
+     *      called on a closed PreparedStatement
+     */
+    public final void setClob(int parameterIndex, Reader reader)
+            throws SQLException {
+        getCallableStatement().setClob(parameterIndex, reader);
+    }
+
     public void setClob(int parameterIndex, Reader reader, long length)
     throws SQLException{
         getPreparedStatement().setClob(parameterIndex,reader,length);
     }
-    
+
+    /**
+     * Sets the designated parameter to a <code>InputStream</code> object.
+     * This method differs from the <code>setBinaryStream(int, InputStream)
+     * </code>  method because it informs the driver that the parameter value
+     * should be sent to the server as a <code>BLOB</code>.
+     *
+     * @param inputStream an object that contains the data to set the parameter
+     *      value to.
+     * @throws SQLException if a database access error occurs, this method is
+     *      called on a closed <code>PreparedStatement</code>
+     */
+    public final void setBlob(int parameterIndex, InputStream inputStream)
+            throws SQLException {
+        getCallableStatement().setBlob(parameterIndex, inputStream);
+    }
+
     public void setBlob(int parameterIndex, InputStream inputStream, long length)
     throws SQLException{
         getPreparedStatement().setBlob(parameterIndex,inputStream,length);
     }
+
+    public final void setNClob(int parameterIndex, Reader reader)
+            throws SQLException {
+        getCallableStatement().setNClob(parameterIndex, reader);
+    }
+
     public void setNClob(int parameterIndex, Reader reader, long length)
     throws SQLException{
         getPreparedStatement().setNClob(parameterIndex,reader,length);
@@ -273,6 +378,11 @@
         getCallableStatement().setCharacterStream(parameterIndex,x,length);
     }
 
+    public final void setAsciiStream(String parameterName, InputStream x)
+            throws SQLException {
+        getCallableStatement().setAsciiStream(parameterName, x);
+    }
+
     /**
      * Sets the designated parameter to the given input stream, which will have
      * the specified number of bytes.
@@ -289,6 +399,11 @@
         getCallableStatement().setAsciiStream(parameterName,x,length);
     }
 
+    public final void setBinaryStream(String parameterName, InputStream x)
+            throws SQLException {
+        getCallableStatement().setBinaryStream(parameterName, x);
+    }
+
     /**
      * Sets the designated parameter to the given input stream, which will have
      * the specified number of bytes.
@@ -303,6 +418,11 @@
     public final void setBinaryStream(String parameterName, InputStream x, long length)
     throws SQLException {
         getCallableStatement().setBinaryStream(parameterName,x,length);
+    }
+
+    public final void setCharacterStream(String parameterName, Reader x)
+            throws SQLException {
+        getCallableStatement().setCharacterStream(parameterName, x);
     }
 
     /**

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?rev=423807&r1=423806&r2=423807&view=diff
==============================================================================
--- 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
Wed Jul 19 23:48:31 2006
@@ -43,6 +43,11 @@
         getPreparedStatement().setNString (index, value);
     }
     
+    public void setNCharacterStream(int parameterIndex, Reader value)
+            throws SQLException {
+        getPreparedStatement().setNCharacterStream(parameterIndex, value);
+    }
+
     public void setNCharacterStream(int index, Reader value, long length) throws SQLException{
         getPreparedStatement().setNCharacterStream (index, value, length);
     }
@@ -60,6 +65,12 @@
     throws SQLException{
         getPreparedStatement().setBlob (parameterIndex, inputStream, length);
     }
+
+    public final void setNClob(int parameterIndex, Reader reader)
+            throws SQLException {
+        getPreparedStatement().setNClob(parameterIndex, reader);
+    }
+
     public void setNClob(int parameterIndex, Reader reader, long length)
     throws SQLException{
         getPreparedStatement().setNClob (parameterIndex, reader, length);
@@ -120,6 +131,18 @@
         getStatement().setPoolable(poolable);
     }    
 
+    /**
+     * 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 that contains the ASCII parameter value
+     * @throws SQLException if a database access error occurs or this method is
+     *      called on a closed <code>PreparedStatement</code>
+     */
+    public final void setAsciiStream(int parameterIndex, InputStream x)
+            throws SQLException {
+        getPreparedStatement().setAsciiStream(parameterIndex, x);
+    }
 
     /**
      * Sets the designated parameter to the given input stream, which will have
@@ -138,6 +161,19 @@
     }
 
     /**
+     * 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.
      *
@@ -154,6 +190,36 @@
     }
 
     /**
+     * Sets the designated parameter to a <code>InputStream</code> object.
+     * This method differs from the <code>setBinaryStream(int, InputStream)
+     * </code>  method because it informs the driver that the parameter value
+     * should be sent to the server as a <code>BLOB</code>.
+     *
+     * @param inputStream an object that contains the data to set the parameter
+     *      value to.
+     * @throws SQLException if a database access error occurs, this method is
+     *      called on a closed <code>PreparedStatement</code>
+     */
+    public final void setBlob(int parameterIndex, InputStream inputStream)
+            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.
      *
@@ -167,5 +233,22 @@
     public final void setCharacterStream(int parameterIndex, Reader x, long length)
     throws SQLException {
         getPreparedStatement().setCharacterStream(parameterIndex,x,length);
+    }
+
+    /**
+     * Sets the designated parameter to a <code>Reader</code> object.
+     * This method differs from the <code>setCharacterStream(int,Reader)</code>
+     * method because it informs the driver that the parameter value should be
+     * sent to the server as a <code>CLOB</code>.
+     *
+     * @param parameterIndex the first parameter is 1, the second is 2, ...
+     * @param reader an object that contains the data to set the parameter
+     *      value to.
+     * @throws SQLException if a database access error occurs, this method is
+     *      called on a closed PreparedStatement
+     */
+    public final void setClob(int parameterIndex, Reader reader)
+            throws SQLException {
+        getPreparedStatement().setClob(parameterIndex, reader);
     }
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=423807&r1=423806&r2=423807&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
Wed Jul 19 23:48:31 2006
@@ -99,8 +99,10 @@
 				new MD[]
 				{
 					new MD( "setArray", new Class[] { int.class, java.sql.Array.class } ),
+						new MD( "setNCharacterStream", new Class[] { int.class, java.io.Reader.class } ),
 						new MD( "setNCharacterStream", new Class[] { int.class, java.io.Reader.class, long.class
} ),
 						new MD( "setNClob", new Class[] { int.class, NClob.class } ),
+						new MD( "setNClob", new Class[] { int.class, java.io.Reader.class } ),
 						new MD( "setNClob", new Class[] { int.class, java.io.Reader.class, long.class } ),
 						new MD( "setNString", new Class[] { int.class, String.class } ),
 						new MD( "setRef", new Class[] { int.class, Ref.class } ),
@@ -171,18 +173,23 @@
 						new MD( "registerOutParameter", new Class[] { String.class, int.class, String.class
} ),
 						new MD( "registerOutParameter", new Class[] { int.class, int.class, String.class }
),
 						new MD( "setArray", new Class[] { int.class, java.sql.Array.class } ),
+						new MD( "setAsciiStream", new Class[] { String.class, java.io.InputStream.class } ),
 						new MD( "setAsciiStream", new Class[] { String.class, java.io.InputStream.class, int.class
} ),
                                                 new MD( "setAsciiStream", new Class[] { String.class,
java.io.InputStream.class, long.class } ),
 						new MD( "setBigDecimal", new Class[] { String.class, java.math.BigDecimal.class } ),
+						new MD( "setBinaryStream", new Class[] { String.class, java.io.InputStream.class }
),
 						new MD( "setBinaryStream", new Class[] { String.class, java.io.InputStream.class, int.class
} ),
                                                 new MD( "setBinaryStream", new Class[] {
String.class, java.io.InputStream.class, long.class } ),
+						new MD( "setBlob", new Class[] { String.class, java.io.InputStream.class } ),
 						new MD( "setBlob", new Class[] { String.class, java.io.InputStream.class, long.class
} ),
 						new MD( "setBlob", new Class[] { String.class, Blob.class } ),
 						new MD( "setBoolean", new Class[] { String.class, boolean.class } ),
 						new MD( "setByte", new Class[] { String.class, byte.class } ),
 						new MD( "setBytes", new Class[] { String.class, byte[].class } ),
+						new MD( "setCharacterStream", new Class[] { String.class, java.io.Reader.class } ),
 						new MD( "setCharacterStream", new Class[] { String.class, java.io.Reader.class, int.class
} ),
                                                 new MD( "setCharacterStream", new Class[]
{ String.class, java.io.Reader.class, long.class } ),
+						new MD( "setClob", new Class[] { String.class, java.io.Reader.class } ),
 						new MD( "setClob", new Class[] { String.class, java.io.Reader.class, long.class } ),
 						new MD( "setClob", new Class[] { String.class, Clob.class } ),
 						new MD( "setDate", new Class[] { String.class, java.sql.Date.class } ),
@@ -192,9 +199,11 @@
 						new MD( "setInt", new Class[] { String.class, int.class } ),
 						new MD( "setLong", new Class[] { String.class, long.class } ),
 						new MD( "setNCharacterStream", new Class[] { int.class, java.io.Reader.class, long.class
} ),
+						new MD( "setNCharacterStream", new Class[] { String.class, java.io.Reader.class } ),
 						new MD( "setNCharacterStream", new Class[] { String.class, java.io.Reader.class, long.class
} ),
 						new MD( "setNClob", new Class[] { int.class, java.io.Reader.class, long.class } ),
 						new MD( "setNClob", new Class[] { int.class, NClob.class } ),
+						new MD( "setNClob", new Class[] { String.class, java.io.Reader.class } ),
 						new MD( "setNClob", new Class[] { String.class, java.io.Reader.class, long.class }
),
 						new MD( "setNClob", new Class[] { String.class, NClob.class } ),
 						new MD( "setNString", new Class[] { int.class, String.class } ),
@@ -267,10 +276,14 @@
 						new MD( "refreshRow", new Class[] { } ),
 						new MD( "updateArray", new Class[] { int.class, java.sql.Array.class } ),
 						new MD( "updateArray", new Class[] { String.class, java.sql.Array.class } ),
+						new MD( "updateNCharacterStream", new Class[] { int.class, java.io.Reader.class } ),
 						new MD( "updateNCharacterStream", new Class[] { int.class, java.io.Reader.class, long.class
} ),
+						new MD( "updateNCharacterStream", new Class[] { String.class, java.io.Reader.class
} ),
 						new MD( "updateNCharacterStream", new Class[] { String.class, java.io.Reader.class,
long.class } ),
 						new MD( "updateNClob", new Class[] { int.class, NClob.class } ),
+						new MD( "updateNClob", new Class[] { int.class, Reader.class } ),
 						new MD( "updateNClob", new Class[] { String.class, NClob.class } ),
+						new MD( "updateNClob", new Class[] { String.class, Reader.class } ),
 						new MD( "updateNString", new Class[] { int.class, String.class } ),
 						new MD( "updateNString", new Class[] { String.class, String.class } ),
 						new MD( "updateRef", new Class[] { int.class, Ref.class } ),



Mime
View raw message