db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r522873 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ client/org/apache/derby/client/net/ testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ testing/o...
Date Tue, 27 Mar 2007 11:53:58 GMT
Author: kahatlen
Date: Tue Mar 27 04:53:57 2007
New Revision: 522873

URL: http://svn.apache.org/viewvc?view=rev&rev=522873
Log:
DERBY-2443: Implement ResultSet updateClob/updateBlob methods on the
NetworkClient

Patch contributed by V. Narayanan.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ResultSetTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetJDBC30Test.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java?view=diff&rev=522873&r1=522872&r2=522873
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java Tue Mar 27 04:53:57 2007
@@ -3805,20 +3805,124 @@
         throw jdbc3MethodNotSupported();
     }
 
+    /**
+     * Updates the designated column with a <code>java.sql.Blob</code> value.
+     * The updater methods are used to update column values in the
+     * current row or the insert row.  The updater methods do not
+     * update the underlying database; instead the <code>updateRow</code> or
+     * <code>insertRow</code> methods are called to update the database.
+     *
+     * @param columnIndex the first column is 1, the second is 2, ...
+     * @param x the new column value
+     * @throws SQLException if the columnIndex is not valid;
+     * if a database access error occurs;
+     * the result set concurrency is <code>CONCUR_READ_ONLY</code>
+     * or this method is called on a closed result set
+     */
     public void updateBlob(int columnIndex, java.sql.Blob x) throws SQLException {
-        throw jdbc3MethodNotSupported();
+        synchronized (connection_) {
+            if (agent_.loggingEnabled()) {
+                agent_.logWriter_.traceEntry(this, "updateBlob",
+                        columnIndex, x);
+            }
+            try {
+                checkUpdatePreconditions(columnIndex, "updateBlob");
+                updateColumn(columnIndex,
+                             agent_.crossConverters_.setObject(
+                                    resultSetMetaData_.types_[columnIndex -1],
+                                    x));
+            } catch (SqlException se) {
+                throw se.getSQLException();
+            }
+        }
     }
 
+    /**
+     * Updates the designated column with a <code>java.sql.Blob</code> value.
+     * The updater methods are used to update column values in the
+     * current row or the insert row.  The updater methods do not
+     * update the underlying database; instead the <code>updateRow</code> or
+     * <code>insertRow</code> methods are called to update the database.
+     *
+     * @param columnName the label for the column specified with the SQL AS
+     * clause. If the SQL AS clause was not specified, then the label is the
+     * name of the column
+     * @param x the new column value
+     * @throws SQLException if the columnLabel is not valid;
+     * if a database access error occurs;
+     * the result set concurrency is <code>CONCUR_READ_ONLY</code>
+     * or this method is called on a closed result set
+     */
     public void updateBlob(String columnName, java.sql.Blob x) throws SQLException {
-        throw jdbc3MethodNotSupported();
+        try {
+            updateBlob(findColumnX(columnName), x);
+        } catch (SqlException se) {
+            throw se.getSQLException();
+        }
     }
-
-    public void updateClob(int columnIndex, java.sql.Clob x) throws SQLException {
-        throw jdbc3MethodNotSupported();
+  
+    /**
+     * Updates the designated column using the given input stream, which
+     * will have the specified number of bytes.
+     * The updater methods are used to update column values in the
+     * current row or the insert row.  The updater methods do not
+     * update the underlying database; instead the <code>updateRow</code> or
+     * <code>insertRow</code> methods are called to update the database.
+     *
+     * @param columnIndex the first column is 1, the second is 2, ...
+     * @param x An object that contains the data to set the parameter
+     * value to.
+     * @param length the number of bytes in the parameter data.
+     * @exception SQLException if the columnIndex is not valid;
+     * if a database access error occurs;
+     * the result set concurrency is <code>CONCUR_READ_ONLY</code>
+     * or this method is called on a closed result set
+     */
+    public void updateBlob(int columnIndex, InputStream x, long length)
+                            throws SQLException {
+        synchronized (connection_) {
+            if (agent_.loggingEnabled()) {
+                agent_.logWriter_.traceEntry(this, "updateBlob",
+                        columnIndex, x, (int)length);
+            }
+            try {
+                checkUpdatePreconditions(columnIndex, "updateBlob");
+                updateColumn(columnIndex,
+                             agent_.crossConverters_.setObject(
+                                    resultSetMetaData_.types_[columnIndex -1],
+                                    new Blob(agent_, x, (int)length)));
+            } catch (SqlException se) {
+                throw se.getSQLException();
+            }
+        }
     }
 
-    public void updateClob(String columnName, java.sql.Clob x) throws SQLException {
-        throw jdbc3MethodNotSupported();
+    /**
+     * Updates the designated column using the given input stream, which
+     * will have the specified number of bytes.
+     * The updater methods are used to update column values in the
+     * current row or the insert row.  The updater methods do not
+     * update the underlying database; instead the <code>updateRow</code> or
+     * <code>insertRow</code> methods are called to update the database.
+     *
+     * @param columnName the label for the column specified with the
+     * SQL AS clause.  If the SQL AS clause was not specified, then the
+     * label is the name of the column
+     * @param x An object that contains the data to set the parameter
+     * value to.
+     * @param length the number of bytes in the parameter data.
+     * @exception SQLException if the columnLabel is not valid;
+     * if a database access error occurs;
+     * the result set concurrency is <code>CONCUR_READ_ONLY</code>
+     * or this method is called on a closed result set
+     */
+    public void updateBlob(String columnName, InputStream x, long length)
+                           throws SQLException {
+        try {
+            updateBlob(findColumnX(columnName), x, length);
+        } catch (SqlException se) {
+            throw se.getSQLException();
+        }
     }
 
     public void updateArray(int columnIndex, java.sql.Array x) throws SQLException {
@@ -5917,6 +6021,145 @@
             throws SQLException {
         try {
             updateClob(findColumnX(columnLabel), reader);
+        } catch (SqlException se) {
+            throw se.getSQLException();
+        }
+    }
+      
+    /**
+     * Updates the designated column using the given <code>Reader</code>
+     * object, which is the given number of characters long.
+     * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
+     * parameter, it may be more practical to send it via a
+     * <code>java.io.Reader</code> object. The JDBC driver will
+     * do any necessary conversion from UNICODE to the database char format.
+     *
+     * <p>
+     * The updater methods are used to update column values in the
+     * current row or the insert row.  The updater methods do not
+     * update the underlying database; instead the <code>updateRow</code> or
+     * <code>insertRow</code> methods are called to update the database.
+     *
+     * @param columnIndex the first column is 1, the second is 2, ...
+     * @param x An object that contains the data to set the parameter value to.
+     * @param length the number of characters in the parameter data.
+     * @exception SQLException if the columnIndex is not valid;
+     * if a database access error occurs;
+     * the result set concurrency is <code>CONCUR_READ_ONLY</code>
+     * or this method is called on a closed result set
+     * @throws SQLFeatureNotSupportedException if the JDBC driver does not
+     * support this method
+     */
+    public void updateClob(int columnIndex, Reader x, long length)
+                throws SQLException {
+        synchronized (connection_) {
+            if (agent_.loggingEnabled()) {
+                agent_.logWriter_.traceEntry(this, "updateClob",
+                        columnIndex, x, (int)length);
+            }
+            try {
+                checkUpdatePreconditions(columnIndex, "updateClob");
+                updateColumn(columnIndex,
+                             agent_.crossConverters_.setObject(
+                                 resultSetMetaData_.types_[columnIndex -1],
+                                 new Clob(agent_, x, (int)length)));
+            } catch (SqlException se) {
+                throw se.getSQLException();
+            }
+        }
+    }
+
+    /**
+     * Updates the designated column using the given <code>Reader</code>
+     * object, which is the given number of characters long.
+     * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
+     * parameter, it may be more practical to send it via a
+     * <code>java.io.Reader</code> object.  The JDBC driver will
+     * do any necessary conversion from UNICODE to the database char format.
+     *
+     * <p>
+     * The updater methods are used to update column values in the
+     * current row or the insert row.  The updater methods do not
+     * update the underlying database; instead the <code>updateRow</code> or
+     * <code>insertRow</code> methods are called to update the database.
+     *
+     * @param columnName the label for the column specified with the
+     * SQL AS clause.  If the SQL AS clause was not specified,
+     * then the label is the name of the column
+     * @param x An object that contains the data to set the parameter value to.
+     * @param length the number of characters in the parameter data.
+     * @exception SQLException if the columnLabel is not valid;
+     * if a database access error occurs;
+     * the result set concurrency is <code>CONCUR_READ_ONLY</code>
+     * or this method is called on a closed result set
+     * @throws SQLFeatureNotSupportedException if the JDBC driver does not
+     * support this method
+     */
+
+    public void updateClob(String columnName, Reader x, long length)
+                           throws SQLException {
+        try {
+            updateClob(findColumnX(columnName), x);
+        } catch (SqlException se) {
+            throw se.getSQLException();
+        }
+    }
+   
+    /**
+     * Updates the designated column with a <code>java.sql.Clob</code> value.
+     * The updater methods are used to update column values in the
+     * current row or the insert row.  The updater methods do not
+     * update the underlying database; instead the <code>updateRow</code> or
+     * <code>insertRow</code> methods are called to update the database.
+     *
+     * @param columnIndex the label for the column specified with the SQL AS
+     *                    clause. If the SQL AS clause was not specified, then
+     *                    the label is the name of the column
+     * @param x the new column value
+     * @throws SQLException if the columnLabel is not valid;
+     * if a database access error occurs;
+     * the result set concurrency is <code>CONCUR_READ_ONLY</code>
+     * or this method is called on a closed result set
+     */
+    public void updateClob(int columnIndex, java.sql.Clob x)
+            throws SQLException {
+        synchronized (connection_) {
+            if (agent_.loggingEnabled()) {
+                agent_.logWriter_.traceEntry(this, "updateClob",
+                        columnIndex, x);
+            }
+            try {
+                checkUpdatePreconditions(columnIndex, "updateClob");
+                updateColumn(columnIndex,
+                             agent_.crossConverters_.setObject(
+                                 resultSetMetaData_.types_[columnIndex -1],
+                                 x));
+            } catch (SqlException se) {
+                throw se.getSQLException();
+            }
+        }
+    }
+
+    /**
+     * Updates the designated column with a <code>java.sql.Clob</code> value.
+     * The updater methods are used to update column values in the
+     * current row or the insert row.  The updater methods do not
+     * update the underlying database; instead the <code>updateRow</code> or
+     * <code>insertRow</code> methods are called to update the database.
+     *
+     * @param columnLabel the label for the column specified with the SQL AS
+     *                    clause. If the SQL AS clause was not specified, then
+     *                    the label is the name of the column
+     * @param x the new column value
+     * @throws SQLException if the columnLabel is not valid;
+     * if a database access error occurs;
+     * the result set concurrency is <code>CONCUR_READ_ONLY</code>
+     * or this method is called on a closed result set
+     */
+    public void updateClob(String columnLabel, java.sql.Clob x)
+            throws SQLException {
+        try {
+            updateClob(findColumnX(columnLabel), x);
         } catch (SqlException se) {
             throw se.getSQLException();
         }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java?view=diff&rev=522873&r1=522872&r2=522873
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java Tue Mar 27 04:53:57 2007
@@ -188,103 +188,7 @@
             throw se.getSQLException();
         }
     }
-    
-    /**
-     * Updates the designated column with a java.sql.Blob value. The updater
-     * methods are used to update column values in the current row or the insert
-     * row. The updater methods do not update the underlying database; instead
-     * the updateRow or insertRow methods are called to update the database.
-     *
-     * @param columnIndex -
-     *            the first column is 1, the second is 2
-     * @param x -
-     *            the new column value
-     * @param length -
-     *            the length of the Blob datatype
-     * @exception SQLException
-     *
-     */
-    public void updateBlob(int columnIndex, InputStream x, long length)
-                            throws SQLException {
-        throw SQLExceptionFactory.notImplemented("updateBlob(int,InputStream,long)");
-    }
 
-    /**
-     * Updates the designated column with a java.sql.Blob value. The updater
-     * methods are used to update column values in the current row or the insert
-     * row. The updater methods do not update the underlying database; instead
-     * the updateRow or insertRow methods are called to update the database.
-     *
-     * @param columnName -
-     *            the name of the column to be updated
-     * @param x -
-     *            the new column value
-     * @param length -
-     *            the length of the Blob datatype
-     * @exception SQLException
-     *
-     */
-
-    public void updateBlob(String columnName, InputStream x, long length)
-                           throws SQLException {
-        throw SQLExceptionFactory.notImplemented("updateBlob(String,inputStream,long)");
-    }
-
-    /**
-     * Updates the designated column with a java.sql.Clob value. The updater
-     * methods are used to update column values in the current row or the insert
-     * row. The updater methods do not update the underlying database; instead
-     * the updateRow or insertRow methods are called to update the database.
-     *
-     * @param columnIndex -
-     *            the first column is 1, the second is 2
-     * @param x -
-     *            the new column value
-     * @exception SQLException
-     *                Feature not implemented for now.
-     */
-    public void updateClob(int columnIndex, Reader x, long length)
-                throws SQLException {
-        throw SQLExceptionFactory.notImplemented("updateClob(int,Reader,long)");
-    }
-
-    /**
-     * Updates the designated column with a java.sql.Clob value. The updater
-     * methods are used to update column values in the current row or the insert
-     * row. The updater methods do not update the underlying database; instead
-     * the updateRow or insertRow methods are called to update the database.
-     *
-     * @param columnName -
-     *            the name of the Clob column
-     * @param x -
-     *            the new column value
-     * @exception SQLException
-     *                Feature not implemented for now.
-     */
-
-     public void updateClob(String columnName, InputStream x, long length)
-                           throws SQLException {
-         throw SQLExceptionFactory.notImplemented("updateClob(String,InputStream,long)");
-     }
-
-     /**
-     * Updates the designated column with a java.sql.Clob value. The updater
-     * methods are used to update column values in the current row or the insert
-     * row. The updater methods do not update the underlying database; instead
-     * the updateRow or insertRow methods are called to update the database.
-     *
-     * @param columnName -
-     *            the name of the Clob column
-     * @param x -
-     *            the new column value
-     * @exception SQLException
-     *                Feature not implemented for now.
-     */
-
-     public void updateClob(String columnName, Reader x, long length)
-                           throws SQLException {
-         throw SQLExceptionFactory.notImplemented("updateClob(String,Reader,long)");
-     }
 
      /**
      * Updates the designated column with a java.sql.NClob value. The updater

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ResultSetTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ResultSetTest.java?view=diff&rev=522873&r1=522872&r2=522873
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ResultSetTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ResultSetTest.java Tue Mar 27 04:53:57 2007
@@ -52,6 +52,11 @@
             0x65, 0x66, 0x67, 0x68, 0x69
         };
 
+    private static final String str1 =
+        "I am the main Input string and I will be Updated";
+
+    private static final String str2 = "I am the string used to update";
+
     /** 
      * Key used to identify inserted rows.
      * Use method <code>requestKey</code> to obtain it. 
@@ -915,7 +920,7 @@
      *
      * @throws SQLException if some error occurs while calling the method
      */
-    public void embeddedUpdateClob()
+    public void testUpdateClob()
     throws Exception {
         //Byte array in which the returned bytes from
         //the Database after the update are stored. This
@@ -1004,13 +1009,47 @@
         rs1.close();
     }
 
+    /**
+     * Test the Clob method that accepts a Input Stream and its length
+     * as input parameter.
+     *
+     * @throws Exception
+     */
+    public void testUpdateClobwithLengthofIS()
+            throws Exception {
+        Reader r1 = new java.io.StringReader(str1);
+        // InputStream for insertion.
+        Reader r2 = new java.io.StringReader(str2);
+
+        // Prepared Statement used to insert the data
+        PreparedStatement ps_sb = prep("dClob");
+        ps_sb.setInt(1, key);
+        ps_sb.setCharacterStream(2, r1);
+        ps_sb.executeUpdate();
+        ps_sb.close();
+
+        // Update operation
+        ResultSet rs1 = fetchUpd("dClob", key);
+        rs1.next();
+        rs1.updateClob(1, r2, str2.length());
+        rs1.updateRow();
+        rs1.close();
+
+        // Query to see whether the data that has been updated.
+        rs1 = fetch("dClob", key);
+        rs1.next();
+        assertEquals(new StringReader(str2),
+                     rs1.getCharacterStream(1));
+        rs1.close();
+    }
+
      /**
      * This methods tests the ResultSet interface method
      * updateBlob
      *
      * @throws SQLException if some error occurs while calling the method
      */
-    public void embeddedUpdateBlob()
+    public void testUpdateBlob()
     throws Exception {
         //Byte array in which the returned bytes from
         //the Database after the update are stored. This
@@ -1099,12 +1138,77 @@
     }
 
     /**
+     * tests the updateBlob that accepts a input stream and the length of the IS.
+     *
+     * @throws an Exception
+     */
+    public void testUpdateBlobWithLengthofIS()
+            throws Exception {
+        InputStream is1 = new java.io.ByteArrayInputStream(BYTES1);
+        // InputStream for insertion.
+        InputStream is2 = new java.io.ByteArrayInputStream(BYTES2);
+
+        // Prepared Statement used to insert the data
+        PreparedStatement ps_sb = prep("dBlob");
+        ps_sb.setInt(1, key);
+        ps_sb.setBinaryStream(2, is1);
+        ps_sb.executeUpdate();
+        ps_sb.close();
+
+        // Update operation
+        ResultSet rs1 = fetchUpd("dBlob", key);
+        rs1.next();
+        rs1.updateBlob(1, is2, BYTES2.length);
+        rs1.updateRow();
+        rs1.close();
+
+        // Query to see whether the data that has been updated.
+        rs1 = fetch("dBlob", key);
+        rs1.next();
+        assertEquals(new ByteArrayInputStream(BYTES2), rs1.getBinaryStream(1));
+        rs1.close();
+    }
+
+    /**
+     * Tests the updateBlob that accepts a input stream and the length of the IS
+     * and the parameter name String.
+     *
+     * @throws an Exception
+     */
+    public void testUpdateBlobStringParameterNameWithLengthofIS()
+            throws Exception {
+        InputStream is1 = new java.io.ByteArrayInputStream(BYTES1);
+        // InputStream for insertion.
+        InputStream is2 = new java.io.ByteArrayInputStream(BYTES2);
+
+        // Prepared Statement used to insert the data
+        PreparedStatement ps_sb = prep("dBlob");
+        ps_sb.setInt(1, key);
+        ps_sb.setBinaryStream(2, is1);
+        ps_sb.executeUpdate();
+        ps_sb.close();
+
+        // Update operation
+        ResultSet rs1 = fetchUpd("dBlob", key);
+        rs1.next();
+        rs1.updateBlob("dBlob", is2, BYTES2.length);
+        rs1.updateRow();
+        rs1.close();
+
+        // Query to see whether the data that has been updated.
+        rs1 = fetch("dBlob", key);
+        rs1.next();
+        assertEquals(new ByteArrayInputStream(BYTES2), rs1.getBinaryStream(1));
+        rs1.close();
+    }
+
+    /**
      * This methods tests the ResultSet interface method
      * updateClob
      *
      * @throws SQLException if some error occurs while calling the method
      */
-    public void embeddedUpdateClobStringParameterName()
+    public void testUpdateClobStringParameterName()
     throws Exception {
         //Byte array in which the returned bytes from
         //the Database after the update are stored. This
@@ -1193,13 +1297,47 @@
         rs1.close();
     }
 
+    /**
+     * Tests the updateClob that accepts a input stream and the length of the IS
+     * and the parameter name String.
+     *
+     * @throws an Exception
+     */
+    public void testUpdateClobStringParameterNameWithLengthofIS()
+            throws Exception {
+        Reader r1 = new java.io.StringReader(str1);
+        // InputStream for insertion.
+        Reader r2 = new java.io.StringReader(str2);
+
+        // Prepared Statement used to insert the data
+        PreparedStatement ps_sb = prep("dClob");
+        ps_sb.setInt(1, key);
+        ps_sb.setCharacterStream(2, r1);
+        ps_sb.executeUpdate();
+        ps_sb.close();
+
+        // Update operation
+        ResultSet rs1 = fetchUpd("dClob", key);
+        rs1.next();
+        rs1.updateClob("dClob", r2, str2.length());
+        rs1.updateRow();
+        rs1.close();
+
+        // Query to see whether the data that has been updated.
+        rs1 = fetch("dClob", key);
+        rs1.next();
+        assertEquals(new StringReader(str2),
+                     rs1.getCharacterStream(1));
+        rs1.close();
+    }
+
      /**
      * This methods tests the ResultSet interface method
      * updateBlob
      *
      * @throws SQLException if some error occurs while calling the method
      */
-    public void embeddedUpdateBlobStringParameterName()
+    public void testUpdateBlobStringParameterName()
     throws Exception {
         //Byte array in which the returned bytes from
         //the Database after the update are stored. This
@@ -1291,42 +1429,10 @@
      **                        T E S T  S E T U P                           *
      ************************************************************************/
 
-    /**
-     * Create suite containing client-only tests.
-     */
-    private static TestSuite clientSuite(String name) {
-        TestSuite clientSuite = new TestSuite(name);
-        return clientSuite;
-    }
-
-    /**
-     * Create suite containing embedded-only tests.
-     */
-    private static TestSuite embeddedSuite(String name) {
-        TestSuite embeddedSuite = new TestSuite(name);
-        embeddedSuite.addTest(new ResultSetTest(
-                    "embeddedUpdateBlob"));
-        embeddedSuite.addTest(new ResultSetTest(
-                    "embeddedUpdateClob"));
-        embeddedSuite.addTest(new ResultSetTest(
-                    "embeddedUpdateClobStringParameterName"));
-        return embeddedSuite;
-    }
-
     public static Test suite() {
         TestSuite rsSuite = new TestSuite("ResultSetTest suite");
-
-        TestSuite embedded = new TestSuite("ResultSetTest:embedded");
-        embedded.addTestSuite(ResultSetTest.class);
-        embedded.addTest(embeddedSuite("ResultSetTest:embedded-only"));
-        rsSuite.addTest(decorateTestSuite(embedded));
-
-        TestSuite client = new TestSuite("ResultSetTest:client");
-        client.addTestSuite(ResultSetTest.class);
-        client.addTest(clientSuite("ResultSetTest:client-only"));
-        rsSuite.addTest(TestConfiguration.clientServerDecorator(
-            decorateTestSuite(client)));
-
+        rsSuite.addTest(decorateTestSuite(TestConfiguration.defaultSuite
+            (ResultSetTest.class,false)));
         return rsSuite;
     }
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetJDBC30Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetJDBC30Test.java?view=diff&rev=522873&r1=522872&r2=522873
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetJDBC30Test.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetJDBC30Test.java Tue Mar 27 04:53:57 2007
@@ -115,11 +115,7 @@
                         " yet.");
             }
         } catch (SQLException se) {
-            if (usingEmbedded()) {
-                assertSQLState(UPDATABLE_RESULTSET_API_DISALLOWED, se);
-            } else {
-                assertSQLState(NOT_IMPLEMENTED, se);
-            }
+            assertSQLState(UPDATABLE_RESULTSET_API_DISALLOWED, se);
         }
         try {
             rs.updateBlob("c", null);
@@ -131,11 +127,7 @@
                         " yet.");
             }
         } catch (SQLException se) {
-            if (usingEmbedded()) {
-                assertSQLState(UPDATABLE_RESULTSET_API_DISALLOWED, se);
-            } else {
-                assertSQLState(NOT_IMPLEMENTED, se);
-            }
+            assertSQLState(UPDATABLE_RESULTSET_API_DISALLOWED, se);
         }
         try {
             rs.updateClob(8, null);
@@ -147,11 +139,7 @@
                         " yet.");
             }
         } catch (SQLException se) {
-            if (usingEmbedded()) {
-                assertSQLState(UPDATABLE_RESULTSET_API_DISALLOWED, se);
-            } else {
-                assertSQLState(NOT_IMPLEMENTED, se);
-            }
+            assertSQLState(UPDATABLE_RESULTSET_API_DISALLOWED, se);
         }
         try {
             rs.updateClob("c", null);
@@ -163,11 +151,7 @@
                         " yet.");
             }
         } catch (SQLException se) {
-            if (usingEmbedded()) {
-                assertSQLState(UPDATABLE_RESULTSET_API_DISALLOWED, se);
-            } else {
-                assertSQLState(NOT_IMPLEMENTED, se);
-            }
+            assertSQLState(UPDATABLE_RESULTSET_API_DISALLOWED, se);
         }
         try {
             rs.updateArray(8, null);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java?view=diff&rev=522873&r1=522872&r2=522873
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java Tue Mar 27 04:53:57 2007
@@ -25,6 +25,7 @@
 
 import junit.framework.*;
 import java.sql.*;
+import java.io.*;
 
 /**
  * Tests updatable result sets.
@@ -35,6 +36,24 @@
  */
 public class UpdatableResultSetTest extends BaseJDBCTestCase {
     
+    private static final byte[] BYTES1 = {
+            0x65, 0x66, 0x67, 0x68, 0x69,
+            0x69, 0x68, 0x67, 0x66, 0x65
+        };
+
+    private static final byte[] BYTES2 = {
+            0x69, 0x68, 0x67, 0x66, 0x65,
+            0x65, 0x66, 0x67, 0x68, 0x69
+        };
+
+    /**
+     * Key used to identify inserted rows.
+     * Use method <code>requestKey</code> to obtain it.
+     **/
+    private static int insertKey = 0;
+
+    private int key = -1;
+
     /** Creates a new instance of UpdatableResultSetTest */
     public UpdatableResultSetTest(String name) {
         super(name);
@@ -51,6 +70,13 @@
         conn.setAutoCommit(false);
         Statement stmt = conn.createStatement();
         
+        stmt.execute("create table UpdateTestTableResultSet (" +
+                            "sno int not null unique," +
+                            "dBlob BLOB," +
+                            "dClob CLOB," +
+                            "dLongVarchar LONG VARCHAR," +
+                            "dLongBit LONG VARCHAR FOR BIT DATA)");
+
         // Quoted table
         stmt.executeUpdate("create table \"my \"\"quoted\"\" table\" (x int)");
         stmt.executeUpdate("insert into \"my \"\"quoted\"\" table\" (x) " +
@@ -368,5 +394,330 @@
         }
         rs.close();
         stmt.close();                
+    }
+
+    /**
+     * This methods tests the ResultSet interface method
+     * updateBlob
+     *
+     * @throws Exception
+     */
+    public void testUpdateBlob()
+    throws Exception {
+        //Byte array in which the returned bytes from
+        //the Database after the update are stored. This
+        //array is then checked to determine if it
+        //has the same elements of the Byte array used for
+        //the update operation
+
+        byte[] bytes_ret = new byte[10];
+
+        //1 Input Stream for insertion
+        InputStream is1 = new java.io.ByteArrayInputStream(BYTES1);
+
+        //2 Input Stream for insertion
+        InputStream is2 = new java.io.ByteArrayInputStream(BYTES2);
+
+        //Prepared Statement used to insert the data
+        PreparedStatement ps_sb = prep("dBlob");
+
+        //first insert
+        ps_sb.setInt(1, key);
+        ps_sb.setBinaryStream(2,is1,BYTES1.length);
+        ps_sb.executeUpdate();
+
+        //second insert
+        int key2 = requestKey();
+        ps_sb.setInt(1, key2);
+        ps_sb.setBinaryStream(2,is2,BYTES2.length);
+        ps_sb.executeUpdate();
+
+        ps_sb.close();
+
+        //Update operation
+        //use a different ResultSet variable so that the
+        //other tests can go on unimpacted
+        //we do not have set methods on Clob and Blob implemented
+        //So query the first Clob from the database
+        //update the second result set with this
+        //Clob value
+
+        ResultSet rs1 = fetch("dBlob", key);
+        rs1.next();
+        Blob blob = rs1.getBlob(1);
+        rs1.close();
+
+        rs1 = fetchUpd("dBlob", key2);
+        rs1.next();
+        rs1.updateBlob(1,blob);
+        rs1.updateRow();
+        rs1.close();
+
+        //Query to see whether the data that has been updated
+        //using the updateBlob method is the same
+        //data that we expected
+
+        rs1 = fetch("dBlob", key2);
+        rs1.next();
+        assertEquals(blob, rs1.getBlob(1));
+        rs1.close();
+    }
+
+    /**
+     * This methods tests the ResultSet interface method
+     * updateBlob
+     *
+     * @throws Exception
+     */
+    public void testUpdateBlobStringParameterName()
+    throws Exception {
+        //Byte array in which the returned bytes from
+        //the Database after the update are stored. This
+        //array is then checked to determine if it
+        //has the same elements of the Byte array used for
+        //the update operation
+
+        byte[] bytes_ret = new byte[10];
+
+        //1 Input Stream for insertion
+        InputStream is1 = new java.io.ByteArrayInputStream(BYTES1);
+
+        //2 Input Stream for insertion
+        InputStream is2 = new java.io.ByteArrayInputStream(BYTES2);
+
+        //Prepared Statement used to insert the data
+        PreparedStatement ps_sb = prep("dBlob");
+
+        //first insert
+        ps_sb.setInt(1, key);
+        ps_sb.setBinaryStream(2,is1,BYTES1.length);
+        ps_sb.executeUpdate();
+
+        //second insert
+        int key2 = requestKey();
+        ps_sb.setInt(1, key2);
+        ps_sb.setBinaryStream(2,is2,BYTES2.length);
+        ps_sb.executeUpdate();
+
+        ps_sb.close();
+
+        //Update operation
+        //use a different ResultSet variable so that the
+        //other tests can go on unimpacted
+        //we do not have set methods on Clob and Blob implemented
+        //So query the first Clob from the database
+        //update the second result set with this
+        //Clob value
+
+        ResultSet rs1 = fetch("dBlob", key);
+        rs1.next();
+        Blob blob = rs1.getBlob(1);
+        rs1.close();
+
+        rs1 = fetchUpd("dBlob", key2);
+        rs1.next();
+        rs1.updateBlob("dBlob",blob);
+        rs1.updateRow();
+        rs1.close();
+
+        //Query to see whether the data that has been updated
+        //using the updateBlob method is the same
+        //data that we expected
+
+        rs1 = fetch("dBlob", key2);
+        rs1.next();
+        assertEquals(blob, rs1.getBlob(1));
+        rs1.close();
+    }
+
+    /**
+     * This methods tests the ResultSet interface method
+     * updateClob
+     *
+     * @throws Exception
+     */
+    public void testUpdateClob()
+    throws Exception {
+        //Byte array in which the returned bytes from
+        //the Database after the update are stored. This
+        //array is then checked to determine if it
+        //has the same elements of the Byte array used for
+        //the update operation
+
+        byte[] bytes_ret = new byte[10];
+
+        //1 Input Stream for insertion
+        InputStream is1 = new java.io.ByteArrayInputStream(BYTES1);
+
+        //2 Input Stream for insertion
+        InputStream is2 = new java.io.ByteArrayInputStream(BYTES2);
+
+        //Prepared Statement used to insert the data
+        PreparedStatement ps_sb = prep("dClob");
+
+        //first insert
+        ps_sb.setInt(1,key);
+        ps_sb.setAsciiStream(2,is1,BYTES1.length);
+        ps_sb.executeUpdate();
+
+        //second insert
+        int key2 = requestKey();
+        ps_sb.setInt(1,key2);
+        ps_sb.setAsciiStream(2,is2,BYTES2.length);
+        ps_sb.executeUpdate();
+
+        ps_sb.close();
+
+        //Update operation
+        //use a different ResultSet variable so that the
+        //other tests can go on unimpacted
+        //we do not have set methods on Clob and Blob implemented
+        //So query the first Clob from the database
+        //update the second result set with this
+        //Clob value
+
+        ResultSet rs1 = fetchUpd("dClob", key);
+        rs1.next();
+        Clob clob = rs1.getClob(1);
+        rs1.close();
+
+        rs1 = fetchUpd("dClob", key2);
+        rs1.next();
+        rs1.updateClob(1,clob);
+        rs1.updateRow();
+        rs1.close();
+
+        //Query to see whether the data that has been updated
+        //using the updateClob method is the same
+        //data that we expected
+
+        rs1 = fetch("dClob", key2);
+        rs1.next();
+        assertEquals(clob, rs1.getClob(1));
+        rs1.close();
+    }
+
+    /**
+     * This methods tests the ResultSet interface method
+     * updateClob
+     *
+     * @throws Exception
+     */
+    public void testUpdateClobStringParameterName()
+    throws Exception {
+        //Byte array in which the returned bytes from
+        //the Database after the update are stored. This
+        //array is then checked to determine if it
+        //has the same elements of the Byte array used for
+        //the update operation
+
+        byte[] bytes_ret = new byte[10];
+
+        //1 Input Stream for insertion
+        InputStream is1 = new java.io.ByteArrayInputStream(BYTES1);
+
+        //2 Input Stream for insertion
+        InputStream is2 = new java.io.ByteArrayInputStream(BYTES2);
+
+        //Prepared Statement used to insert the data
+        PreparedStatement ps_sb = prep("dClob");
+
+        //first insert
+        ps_sb.setInt(1, key);
+        ps_sb.setAsciiStream(2,is1,BYTES1.length);
+        ps_sb.executeUpdate();
+
+        //second insert
+        int key2 = requestKey();
+        ps_sb.setInt(1, key2);
+        ps_sb.setAsciiStream(2,is2,BYTES2.length);
+        ps_sb.executeUpdate();
+
+        ps_sb.close();
+
+        //Update operation
+        //use a different ResultSet variable so that the
+        //other tests can go on unimpacted
+        //we do not have set methods on Clob and Blob implemented
+        //So query the first Clob from the database
+        //update the second result set with this
+        //Clob value
+
+        ResultSet rs1 = fetch("dClob", key);
+        rs1.next();
+        Clob clob = rs1.getClob(1);
+        rs1.close();
+
+        rs1 = fetchUpd("dClob", key2);
+        rs1.next();
+        rs1.updateClob("dClob",clob);
+        rs1.updateRow();
+        rs1.close();
+
+        //Query to see whether the data that has been updated
+        //using the updateClob method is the same
+        //data that we expected
+
+        rs1 = fetch("dClob", key2);
+        rs1.next();
+        assertEquals(clob, rs1.getClob(1));
+        rs1.close();
+    }
+
+    /**
+     * Get a key that is used to identify an inserted row.
+     * Introduced to avoid having to delete table contents after each test,
+     * and because the order of the tests is not guaranteed.
+     *
+     * @return an integer in range [1, Integer.MAX_VALUE -1]
+     */
+    private static final int requestKey() {
+        return ++insertKey;
+    }
+
+    /**
+     * Prepare commonly used statement to insert a row.
+     *
+     * @param colName name of the column to insert into
+     * @throws SQLException
+     */
+    private PreparedStatement prep(String colName)
+            throws SQLException {
+        return prepareStatement("insert into UpdateTestTableResultSet " +
+                "(sno, " + colName + ") values (?,?)");
+    }
+
+    /**
+     * Fetch the specified row for update.
+     *
+     * @param colName name of the column to fetch
+     * @param key identifier for row to fetch
+     * @return a <code>ResultSet</code> with zero or one row, depending on
+     *      the key used
+     * @throws SQLException
+     */
+    private ResultSet fetchUpd(String colName, int key)
+            throws SQLException {
+        Statement stmt = createStatement(ResultSet.TYPE_FORWARD_ONLY,
+                                             ResultSet.CONCUR_UPDATABLE);
+        return stmt.executeQuery("select " + colName +
+                " from UpdateTestTableResultSet where sno = " + key +
+                " for update");
+    }
+
+    /**
+     * Fetch the specified row.
+     *
+     * @param colName name of the column to fetch
+     * @param key identifier for row to fetch
+     * @return a <code>ResultSet</code> with zero or one row, depending on
+     *      the key used
+     * @throws SQLException
+     */
+    private ResultSet fetch(String colName, int key)
+            throws SQLException {
+        Statement stmt = createStatement();
+        return stmt.executeQuery("select " + colName +
+                " from UpdateTestTableResultSet where sno = " + key);
     }
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java?view=diff&rev=522873&r1=522872&r2=522873
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java Tue Mar 27 04:53:57 2007
@@ -205,23 +205,23 @@
         //                                            e        m
         //                                            a
         //                                            m
-        /* 0 SMALLINT      */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "22018", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "0A000", "XCL12", "XCL12", "XCL12", "0A000", "PASS",  "PASS", "0A000", "0A000"},
-        /* 1 INTEGER       */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "22018", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "0A000", "XCL12", "XCL12", "XCL12", "0A000", "PASS",  "PASS", "0A000", "0A000"},
-        /* 2 BIGINT        */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "22018", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "0A000", "XCL12", "XCL12", "XCL12", "0A000", "PASS",  "PASS", "0A000", "0A000"},
-        /* 3 DECIMAL       */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "22018", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "0A000", "XCL12", "XCL12", "XCL12", "0A000", "PASS",  "PASS", "0A000", "0A000"},
-        /* 4 REAL          */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "0A000", "XCL12", "XCL12", "XCL12", "0A000", "PASS",  "PASS", "0A000", "0A000"},
-        /* 5 DOUBLE        */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "0A000", "XCL12", "XCL12", "XCL12", "0A000", "PASS",  "PASS", "0A000", "0A000"},
-        /* 6 CHAR          */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "0A000", "PASS",  "PASS",  "PASS",  "0A000", "PASS",  "PASS", "0A000", "0A000"},
-        /* 7 VARCHAR       */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "0A000", "PASS",  "PASS",  "PASS",  "0A000", "PASS",  "PASS", "0A000", "0A000"},
-        /* 8 LONGVARCHAR   */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "0A000", "PASS",  "PASS",  "PASS",  "0A000", "PASS",  "PASS", "0A000", "0A000"},
-        /* 9 CHAR FOR BIT  */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "0A000", "XCL12", "XCL12", "XCL12", "0A000", "XCL12", "PASS", "0A000", "0A000"},
-        /* 10 VARCH. BIT   */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "0A000", "XCL12", "XCL12", "XCL12", "0A000", "XCL12", "PASS", "0A000", "0A000"},
-        /* 11 LONGVAR. BIT */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "0A000", "XCL12", "XCL12", "XCL12", "0A000", "XCL12", "PASS", "0A000", "0A000"},
-        /* 12 CLOB         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "0A000", "XCL12", "XCL12", "XCL12", "0A000", "XCL12", "PASS", "0A000", "0A000"},
-        /* 13 DATE         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "0A000", "PASS",  "XCL12", "PASS",  "0A000", "XCL12", "PASS", "0A000", "0A000"},
-        /* 14 TIME         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "0A000", "XCL12", "PASS",  "PASS",  "0A000", "XCL12", "PASS", "0A000", "0A000"},
-        /* 15 TIMESTAMP    */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "0A000", "PASS",  "XCL12", "PASS",  "0A000", "XCL12", "PASS", "0A000", "0A000"},
-        /* 16 BLOB         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "0A000", "XCL12", "XCL12", "XCL12", "0A000", "XCL12", "PASS", "0A000", "0A000"},
+        /* 0 SMALLINT      */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "22018", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS", "0A000", "0A000"},
+        /* 1 INTEGER       */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "22018", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS", "0A000", "0A000"},
+        /* 2 BIGINT        */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "22018", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS", "0A000", "0A000"},
+        /* 3 DECIMAL       */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "22018", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS", "0A000", "0A000"},
+        /* 4 REAL          */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS", "0A000", "0A000"},
+        /* 5 DOUBLE        */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS", "0A000", "0A000"},
+        /* 6 CHAR          */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "PASS",  "XCL12", "PASS",  "PASS", "0A000", "0A000"},
+        /* 7 VARCHAR       */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "PASS",  "XCL12", "PASS",  "PASS", "0A000", "0A000"},
+        /* 8 LONGVARCHAR   */ {"PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "PASS",  "XCL12", "PASS",  "PASS", "0A000", "0A000"},
+        /* 9 CHAR FOR BIT  */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS", "0A000", "0A000"},
+        /* 10 VARCH. BIT   */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS", "0A000", "0A000"},
+        /* 11 LONGVAR. BIT */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS", "0A000", "0A000"},
+        /* 12 CLOB         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "PASS", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS", "0A000", "0A000"},
+        /* 13 DATE         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "PASS",  "XCL12", "XCL12", "PASS", "0A000", "0A000"},
+        /* 14 TIME         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "PASS", "0A000", "0A000"},
+        /* 15 TIMESTAMP    */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "XCL12", "PASS",  "XCL12", "XCL12", "PASS", "0A000", "0A000"},
+        /* 16 BLOB         */ {"XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "XCL12", "PASS",  "PASS",  "XCL12", "XCL12", "XCL12", "XCL12", "PASS", "XCL12", "PASS", "0A000", "0A000"},
     };
     
     // This table contains the expected result of the combination of datatype
@@ -2449,18 +2449,9 @@
                 } catch (SQLException e) {
                     // updateArray and updateRef are not implemented on both 
                     // drivers
-                    // updateClob is not implemented in the client
-                    // updateBlob is not implemented in the client
-                    if (
-                            (updateXXXName == 20) || (updateXXXName == 21) || 
-                            (usingDerbyNetClient() && updateXXXName == 13) || 
-                            (usingDerbyNetClient() && updateXXXName == 17))   
-                    {
+                    if((updateXXXName == 20) || (updateXXXName == 21)) {
                         assertSQLState("FAIL - unexpected exception on " + 
                                 allUpdateXXXNames[updateXXXName-1], "0A000", e);
-                    } else {
-                        assertSQLState("FAIL - unexpected exception on " + 
-                                allUpdateXXXNames[updateXXXName-1], "XJ083", e);
                     }
                 }
                 rs.close();



Mime
View raw message