db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r371561 [10/11] - in /db/derby/code/trunk/java: client/org/apache/derby/client/ client/org/apache/derby/client/am/ client/org/apache/derby/client/net/ client/org/apache/derby/jdbc/ testing/org/apache/derbyTesting/functionTests/master/DerbyN...
Date Mon, 23 Jan 2006 15:58:53 GMT
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java?rev=371561&r1=371560&r2=371561&view=diff
==============================================================================
--- 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 Mon Jan 23 07:58:34 2006
@@ -634,309 +634,297 @@
     private void buildFDODTA(int numVars,
                              int[][] protocolTypesAndLengths,
                              Object[] inputs) throws SqlException {
-        long dataLength = 0;
-        Object o = null;
+        try
+        {
+            long dataLength = 0;
+            Object o = null;
 
-        markLengthBytes(CodePoint.FDODTA);
-        write1Byte(FdocaConstants.NULL_LID); // write the 1-byte row indicator
+            markLengthBytes(CodePoint.FDODTA);
+            write1Byte(FdocaConstants.NULL_LID); // write the 1-byte row indicator
 
-        // write data for each input column
-        for (int i = 0; i < numVars; i++) {
-            if (inputs[i] == null) {
-                if ((protocolTypesAndLengths[i][0] % 2) == 1) {
-                    write1Byte(FdocaConstants.NULL_DATA);
+            // write data for each input column
+            for (int i = 0; i < numVars; i++) {
+                if (inputs[i] == null) {
+                    if ((protocolTypesAndLengths[i][0] % 2) == 1) {
+                        write1Byte(FdocaConstants.NULL_DATA);
+                    } else {
+                        //bug check
+                    }
                 } else {
-                    //bug check
-                }
-            } else {
-                if ((protocolTypesAndLengths[i][0] % 2) == 1) {
-                    write1Byte(FdocaConstants.INDICATOR_NULLABLE);
-                }
-
-                switch (protocolTypesAndLengths[i][0] | 0x01) {  // mask out null indicator
-                case DRDAConstants.DRDA_TYPE_NVARMIX:
-                case DRDAConstants.DRDA_TYPE_NLONGMIX:
-                    // What to do for server that don't understand 1208 (UTF-8)
-                    // check for a promototed type, and use that instead if it exists
-                    o = retrievePromotedParameterIfExists(i);
-                    if (o == null) {
-                        writeSingleorMixedCcsidLDString((String) inputs[i], netAgent_.typdef_.getCcsidMbcEncoding());
-                    } else { // use the promototed object instead
-                        Clob c = (Clob) o;
-                        dataLength = c.length();
-                        setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
+                    if ((protocolTypesAndLengths[i][0] % 2) == 1) {
+                        write1Byte(FdocaConstants.INDICATOR_NULLABLE);
                     }
-                    break;
 
-                case DRDAConstants.DRDA_TYPE_NVARCHAR:
-                case DRDAConstants.DRDA_TYPE_NLONG:
-                    o = retrievePromotedParameterIfExists(i);
-                    if (o == null) {
+                    switch (protocolTypesAndLengths[i][0] | 0x01) {  // mask out null indicator
+                    case DRDAConstants.DRDA_TYPE_NVARMIX:
+                    case DRDAConstants.DRDA_TYPE_NLONGMIX:
+                        // What to do for server that don't understand 1208 (UTF-8)
+                        // check for a promototed type, and use that instead if it exists
+                        o = retrievePromotedParameterIfExists(i);
+                        if (o == null) {
+                            writeSingleorMixedCcsidLDString((String) inputs[i], netAgent_.typdef_.getCcsidMbcEncoding());
+                        } else { // use the promototed object instead
+                            Clob c = (Clob) o;
+                            dataLength = c.length();
+                            setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
+                        }
+                        break;
 
-                    } else { // use the promototed object instead
-                        dataLength = ((Clob) o).length();
-                        setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
-                    }
-                    break;
+                    case DRDAConstants.DRDA_TYPE_NVARCHAR:
+                    case DRDAConstants.DRDA_TYPE_NLONG:
+                        o = retrievePromotedParameterIfExists(i);
+                        if (o == null) {
+
+                        } else { // use the promototed object instead
+                            dataLength = ((Clob) o).length();
+                            setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
+                        }
+                        break;
 
-                case DRDAConstants.DRDA_TYPE_NINTEGER:
-                    writeIntFdocaData(((Integer) inputs[i]).intValue());
-                    break;
-                case DRDAConstants.DRDA_TYPE_NSMALL:
-                    writeShortFdocaData(((Short) inputs[i]).shortValue());
-                    break;
-                case DRDAConstants.DRDA_TYPE_NFLOAT4:
-                    writeFloat(((Float) inputs[i]).floatValue());
-                    break;
-                case DRDAConstants.DRDA_TYPE_NFLOAT8:
-                    writeDouble(((Double) inputs[i]).doubleValue());
-                    break;
-                case DRDAConstants.DRDA_TYPE_NDECIMAL:
-                    writeBigDecimal((java.math.BigDecimal) inputs[i],
-                            (protocolTypesAndLengths[i][1] >> 8) & 0xff, // described precision not actual
-                            protocolTypesAndLengths[i][1] & 0xff); // described scale, not actual
-                    break;
-                case DRDAConstants.DRDA_TYPE_NDATE:
-                    writeDate((java.sql.Date) inputs[i]);
-                    break;
-                case DRDAConstants.DRDA_TYPE_NTIME:
-                    writeTime((java.sql.Time) inputs[i]);
-                    break;
-                case DRDAConstants.DRDA_TYPE_NTIMESTAMP:
-                    writeTimestamp((java.sql.Timestamp) inputs[i]);
-                    break;
-                case DRDAConstants.DRDA_TYPE_NINTEGER8:
-                    writeLongFdocaData(((Long) inputs[i]).longValue());
-                    break;
-                case DRDAConstants.DRDA_TYPE_NVARBYTE:
-                case DRDAConstants.DRDA_TYPE_NLONGVARBYTE:
-                    o = retrievePromotedParameterIfExists(i);
-                    if (o == null) {
-                        writeLDBytes((byte[]) inputs[i]);
-                    } else { // use the promototed object instead
-                        Blob b = (Blob) o;
-                        dataLength = b.length();
-                        setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
-                    }
-                    break;
-                case DRDAConstants.DRDA_TYPE_NLOBCSBCS:
-                case DRDAConstants.DRDA_TYPE_NLOBCDBCS:
-                    // check for a promoted Clob
-                    o = retrievePromotedParameterIfExists(i);
-                    if (o == null) {
-                        try {
-                            dataLength = ((java.sql.Clob) inputs[i]).length();
-                        } catch (java.sql.SQLException e) {
-                            if (!(e instanceof org.apache.derby.client.am.SqlException)) {
-                                SqlException toThrow = new SqlException(netAgent_.logWriter_,
-                                        "Error obtaining length of external clob object, exception follows. ");
-                                toThrow.setNextException(e);
-                                throw toThrow;
-                            } else {
+                    case DRDAConstants.DRDA_TYPE_NINTEGER:
+                        writeIntFdocaData(((Integer) inputs[i]).intValue());
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NSMALL:
+                        writeShortFdocaData(((Short) inputs[i]).shortValue());
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NFLOAT4:
+                        writeFloat(((Float) inputs[i]).floatValue());
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NFLOAT8:
+                        writeDouble(((Double) inputs[i]).doubleValue());
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NDECIMAL:
+                        writeBigDecimal((java.math.BigDecimal) inputs[i],
+                                (protocolTypesAndLengths[i][1] >> 8) & 0xff, // described precision not actual
+                                protocolTypesAndLengths[i][1] & 0xff); // described scale, not actual
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NDATE:
+                        writeDate((java.sql.Date) inputs[i]);
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NTIME:
+                        writeTime((java.sql.Time) inputs[i]);
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NTIMESTAMP:
+                        writeTimestamp((java.sql.Timestamp) inputs[i]);
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NINTEGER8:
+                        writeLongFdocaData(((Long) inputs[i]).longValue());
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NVARBYTE:
+                    case DRDAConstants.DRDA_TYPE_NLONGVARBYTE:
+                        o = retrievePromotedParameterIfExists(i);
+                        if (o == null) {
+                            writeLDBytes((byte[]) inputs[i]);
+                        } else { // use the promototed object instead
+                            Blob b = (Blob) o;
+                            dataLength = b.length();
+                            setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
+                        }
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NLOBCSBCS:
+                    case DRDAConstants.DRDA_TYPE_NLOBCDBCS:
+                        // check for a promoted Clob
+                        o = retrievePromotedParameterIfExists(i);
+                        if (o == null) {
+                            try {
+                                dataLength = ((java.sql.Clob) inputs[i]).length();
+                            } catch (java.sql.SQLException e) {
                                 throw new SqlException(netAgent_.logWriter_, e, "Error obtaining length of blob object, exception follows. ");
                             }
+                        } else {
+                            dataLength = ((Clob) o).length();
                         }
-                    } else {
-                        dataLength = ((Clob) o).length();
-                    }
-                    setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
-                    break;
-                case DRDAConstants.DRDA_TYPE_NLOBBYTES:
-                    // check for a promoted Clob
-                    o = retrievePromotedParameterIfExists(i);
-                    if (o == null) {
-                        try {
-                            dataLength = ((java.sql.Blob) inputs[i]).length();
-                        } catch (java.sql.SQLException e) {
-                            if (!(e instanceof org.apache.derby.client.am.SqlException)) {
-                                SqlException toThrow = new SqlException(netAgent_.logWriter_,
-                                        "Error obtaining length of external blob object, exception follows. ");
-                                toThrow.setNextException(e);
-                                throw toThrow;
-                            } else {
+                        setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NLOBBYTES:
+                        // check for a promoted Clob
+                        o = retrievePromotedParameterIfExists(i);
+                        if (o == null) {
+                            try {
+                                dataLength = ((java.sql.Blob) inputs[i]).length();
+                            } catch (java.sql.SQLException e) {
                                 throw new SqlException(netAgent_.logWriter_, e, "Error obtaining length of blob object, exception follows. ");
                             }
+                        } else { // use promoted Blob
+                            dataLength = ((Blob) o).length();
+                        }
+                        setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
+                        break;
+                    case DRDAConstants.DRDA_TYPE_NLOBCMIXED:
+                        // check for a promoted Clob
+                        o = retrievePromotedParameterIfExists(i);
+                        if (o == null) {
+                            if (((Clob) inputs[i]).isString()) {
+                                dataLength = ((Clob) inputs[i]).getUTF8Length();
+                            } else // must be a Unicode stream
+                            {
+                                dataLength = ((Clob) inputs[i]).length();
+                            }
+                        } else { // use promoted Clob
+                            dataLength = ((Clob) o).length();
                         }
-                    } else { // use promoted Blob
-                        dataLength = ((Blob) o).length();
+                        setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
+                        break;
+                    default:
+                        throw new SqlException(netAgent_.logWriter_, "unrecognized jdbc type. " +
+                                " type: " + protocolTypesAndLengths[i][0] +
+                                ", columnCount: " + numVars +
+                                ", columnIndex: " + i);
                     }
-                    setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
-                    break;
-                case DRDAConstants.DRDA_TYPE_NLOBCMIXED:
-                    // check for a promoted Clob
-                    o = retrievePromotedParameterIfExists(i);
-                    if (o == null) {
-                        if (((Clob) inputs[i]).isString()) {
-                            dataLength = ((Clob) inputs[i]).getUTF8Length();
-                        } else // must be a Unicode stream
-                        {
-                            dataLength = ((Clob) inputs[i]).length();
-                        }
-                    } else { // use promoted Clob
-                        dataLength = ((Clob) o).length();
-                    }
-                    setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
-                    break;
-                default:
-                    throw new SqlException(netAgent_.logWriter_, "unrecognized jdbc type. " +
-                            " type: " + protocolTypesAndLengths[i][0] +
-                            ", columnCount: " + numVars +
-                            ", columnIndex: " + i);
                 }
             }
+            updateLengthBytes(); // for fdodta
+        }
+        catch ( java.sql.SQLException se )
+        {
+            throw new SqlException(se);
         }
-        updateLengthBytes(); // for fdodta
     }
 
     // preconditions:
     private void buildEXTDTA(ColumnMetaData parameterMetaData,
                              Object[] inputRow,
                              boolean chained) throws SqlException {
-        // build the EXTDTA data, if necessary
-        if (extdtaPositions_ != null) {
-            boolean chainFlag, chainedWithSameCorrelator;
-
-            for (int i = 0; i < extdtaPositions_.size(); i++) {
-                int index = ((Integer) extdtaPositions_.get(i)).intValue();
-
-                // is this the last EXTDTA to be built?
-                if (i != extdtaPositions_.size() - 1) { // no
-                    chainFlag = true;
-                    chainedWithSameCorrelator = true;
-                } else { // yes
-                    chainFlag = chained;
-                    chainedWithSameCorrelator = false;
-                }
-
-                // do we have to write a null byte?
-                boolean writeNullByte = false;
-                if (parameterMetaData.nullable_[index]) {
-                    writeNullByte = true;
-                }
-                // Use the type of the input parameter rather than the input
-                // column if possible.
-                int parameterType = parameterMetaData.clientParamtertype_[index];
-                if (parameterType == 0) {
-                    parameterType = parameterMetaData.types_[index];
-                }
-
-                // the follow types are possible due to promotion to BLOB
-                if (parameterType == Types.BLOB
-                        || parameterType == Types.BINARY
-                        || parameterType == Types.VARBINARY
-                        || parameterType == Types.LONGVARBINARY) {
-                    Blob o = (Blob) retrievePromotedParameterIfExists(index);
-                    java.sql.Blob b = (o == null) ? (java.sql.Blob) inputRow[index] : o;
-                    boolean isExternalBlob = !(b instanceof org.apache.derby.client.am.Blob);
-                    if (isExternalBlob) {
-                        try {
+        try
+        {
+            // build the EXTDTA data, if necessary
+            if (extdtaPositions_ != null) {
+                boolean chainFlag, chainedWithSameCorrelator;
+
+                for (int i = 0; i < extdtaPositions_.size(); i++) {
+                    int index = ((Integer) extdtaPositions_.get(i)).intValue();
+
+                    // is this the last EXTDTA to be built?
+                    if (i != extdtaPositions_.size() - 1) { // no
+                        chainFlag = true;
+                        chainedWithSameCorrelator = true;
+                    } else { // yes
+                        chainFlag = chained;
+                        chainedWithSameCorrelator = false;
+                    }
+
+                    // do we have to write a null byte?
+                    boolean writeNullByte = false;
+                    if (parameterMetaData.nullable_[index]) {
+                        writeNullByte = true;
+                    }
+                    // Use the type of the input parameter rather than the input
+                    // column if possible.
+                    int parameterType = parameterMetaData.clientParamtertype_[index];
+                    if (parameterType == 0) {
+                        parameterType = parameterMetaData.types_[index];
+                    }
+
+                    // the follow types are possible due to promotion to BLOB
+                    if (parameterType == Types.BLOB
+                            || parameterType == Types.BINARY
+                            || parameterType == Types.VARBINARY
+                            || parameterType == Types.LONGVARBINARY) {
+                        Blob o = (Blob) retrievePromotedParameterIfExists(index);
+                        java.sql.Blob b = (o == null) ? (java.sql.Blob) inputRow[index] : o;
+                        boolean isExternalBlob = !(b instanceof org.apache.derby.client.am.Blob);
+                        if (isExternalBlob) {
+                            try {
+                                writeScalarStream(chainFlag,
+                                        chainedWithSameCorrelator,
+                                        CodePoint.EXTDTA,
+                                        (int) b.length(),
+                                        b.getBinaryStream(),
+                                        writeNullByte,
+                                        index + 1);
+                            } catch (java.sql.SQLException e) {
+                                throw new SqlException(netAgent_.logWriter_, e, "Error obtaining length of blob object, exception follows. ");
+                            }
+                        } else if (((Blob) b).isBinaryStream()) {
                             writeScalarStream(chainFlag,
                                     chainedWithSameCorrelator,
                                     CodePoint.EXTDTA,
-                                    (int) b.length(),
-                                    b.getBinaryStream(),
+                                    (int) ((Blob) b).length(),
+                                    ((Blob) b).getBinaryStream(),
                                     writeNullByte,
                                     index + 1);
-                        } catch (java.sql.SQLException e) {
-                            if (!(e instanceof org.apache.derby.client.am.SqlException)) {
-                                SqlException toThrow = new SqlException(netAgent_.logWriter_, "Error occurred while streaming from external blob object, exception follows. ");
-                                toThrow.setNextException(e);
-                                throw toThrow;
-                            } else {
-                                throw new SqlException(netAgent_.logWriter_, e, "Error obtaining length of blob object, exception follows. ");
-                            }
-                        }
-                    } else if (((Blob) b).isBinaryStream()) {
-                        writeScalarStream(chainFlag,
-                                chainedWithSameCorrelator,
-                                CodePoint.EXTDTA,
-                                (int) ((Blob) b).length(),
-                                ((Blob) b).getBinaryStream(),
-                                writeNullByte,
-                                index + 1);
-                    } else { // must be a binary string
-                        // note: a possible optimization is to use writeScalarLobBytes
-                        //       when the input is small
-                        //   use this: if (b.length () < DssConstants.MAX_DSS_LEN - 6 - 4)
-                        //               writeScalarLobBytes (...)
-                        // Yes, this would avoid having to new up a java.io.ByteArrayInputStream
-                        writeScalarStream(chainFlag,
-                                chainedWithSameCorrelator,
-                                CodePoint.EXTDTA,
-                                (int) ((Blob) b).length(),
-                                ((Blob) b).getBinaryStream(),
-                                writeNullByte,
-                                index + 1);
-                    }
-                }
-                // the follow types are possible due to promotion to CLOB
-                else if (
-                        parameterType == Types.CLOB
-                        || parameterType == Types.CHAR
-                        || parameterType == Types.VARCHAR
-                        || parameterType == Types.LONGVARCHAR) {
-                    Clob o = (Clob) retrievePromotedParameterIfExists(index);
-                    java.sql.Clob c = (o == null) ? (java.sql.Clob) inputRow[index] : o;
-                    boolean isExternalClob = !(c instanceof org.apache.derby.client.am.Clob);
-
-                    if (isExternalClob) {
-                        try {
+                        } else { // must be a binary string
+                            // note: a possible optimization is to use writeScalarLobBytes
+                            //       when the input is small
+                            //   use this: if (b.length () < DssConstants.MAX_DSS_LEN - 6 - 4)
+                            //               writeScalarLobBytes (...)
+                            // Yes, this would avoid having to new up a java.io.ByteArrayInputStream
                             writeScalarStream(chainFlag,
                                     chainedWithSameCorrelator,
                                     CodePoint.EXTDTA,
-                                    (int) c.length(),
-                                    c.getCharacterStream(),
+                                    (int) ((Blob) b).length(),
+                                    ((Blob) b).getBinaryStream(),
                                     writeNullByte,
                                     index + 1);
-                        } catch (java.sql.SQLException e) {
-                            if (!(e instanceof org.apache.derby.client.am.SqlException)) {
-                                SqlException toThrow = new SqlException(netAgent_.logWriter_, "Error occurred while streaming from external clob object, exception follows. ");
-                                toThrow.setNextException(e);
-                                throw toThrow;
-                            } else {
+                        }
+                    }
+                    // the follow types are possible due to promotion to CLOB
+                    else if (
+                            parameterType == Types.CLOB
+                            || parameterType == Types.CHAR
+                            || parameterType == Types.VARCHAR
+                            || parameterType == Types.LONGVARCHAR) {
+                        Clob o = (Clob) retrievePromotedParameterIfExists(index);
+                        java.sql.Clob c = (o == null) ? (java.sql.Clob) inputRow[index] : o;
+                        boolean isExternalClob = !(c instanceof org.apache.derby.client.am.Clob);
+
+                        if (isExternalClob) {
+                            try {
+                                writeScalarStream(chainFlag,
+                                        chainedWithSameCorrelator,
+                                        CodePoint.EXTDTA,
+                                        (int) c.length(),
+                                        c.getCharacterStream(),
+                                        writeNullByte,
+                                        index + 1);
+                            } catch (java.sql.SQLException e) {
                                 throw new SqlException(netAgent_.logWriter_, e, "Error obtaining length of blob object, exception follows. ");
                             }
+                        } else if (((Clob) c).isCharacterStream()) {
+                            writeScalarStream(chainFlag,
+                                    chainedWithSameCorrelator,
+                                    CodePoint.EXTDTA,
+                                    (int) ((Clob) c).length(),
+                                    ((Clob) c).getCharacterStream(),
+                                    writeNullByte,
+                                    index + 1);
+                        } else if (((Clob) c).isAsciiStream()) {
+                            writeScalarStream(chainFlag,
+                                    chainedWithSameCorrelator,
+                                    CodePoint.EXTDTA,
+                                    (int) ((Clob) c).length(),
+                                    ((Clob) c).getAsciiStream(),
+                                    writeNullByte,
+                                    index + 1);
+                        } else if (((Clob) c).isUnicodeStream()) {
+                            writeScalarStream(chainFlag,
+                                    chainedWithSameCorrelator,
+                                    CodePoint.EXTDTA,
+                                    (int) ((Clob) c).length(),
+                                    ((Clob) c).getUnicodeStream(),
+                                    writeNullByte,
+                                    index + 1);
+                        } else { // must be a String
+                            // note: a possible optimization is to use writeScalarLobBytes
+                            //       when the input is small.
+                            //   use this: if (c.length () < DssConstants.MAX_DSS_LEN - 6 - 4)
+                            //               writeScalarLobBytes (...)
+                            writeScalarStream(chainFlag,
+                                    chainedWithSameCorrelator,
+                                    CodePoint.EXTDTA,
+                                    (int) ((Clob) c).getUTF8Length(),
+                                    new java.io.ByteArrayInputStream(((Clob) c).getUtf8String()),
+                                    writeNullByte,
+                                    index + 1);
                         }
-                    } else if (((Clob) c).isCharacterStream()) {
-                        writeScalarStream(chainFlag,
-                                chainedWithSameCorrelator,
-                                CodePoint.EXTDTA,
-                                (int) ((Clob) c).length(),
-                                ((Clob) c).getCharacterStream(),
-                                writeNullByte,
-                                index + 1);
-                    } else if (((Clob) c).isAsciiStream()) {
-                        writeScalarStream(chainFlag,
-                                chainedWithSameCorrelator,
-                                CodePoint.EXTDTA,
-                                (int) ((Clob) c).length(),
-                                ((Clob) c).getAsciiStream(),
-                                writeNullByte,
-                                index + 1);
-                    } else if (((Clob) c).isUnicodeStream()) {
-                        writeScalarStream(chainFlag,
-                                chainedWithSameCorrelator,
-                                CodePoint.EXTDTA,
-                                (int) ((Clob) c).length(),
-                                ((Clob) c).getUnicodeStream(),
-                                writeNullByte,
-                                index + 1);
-                    } else { // must be a String
-                        // note: a possible optimization is to use writeScalarLobBytes
-                        //       when the input is small.
-                        //   use this: if (c.length () < DssConstants.MAX_DSS_LEN - 6 - 4)
-                        //               writeScalarLobBytes (...)
-                        writeScalarStream(chainFlag,
-                                chainedWithSameCorrelator,
-                                CodePoint.EXTDTA,
-                                (int) ((Clob) c).getUTF8Length(),
-                                new java.io.ByteArrayInputStream(((Clob) c).getUtf8String()),
-                                writeNullByte,
-                                index + 1);
                     }
                 }
             }
         }
+        catch ( java.sql.SQLException se )
+        {
+            throw new SqlException(se);
+        }
     }
 
 
@@ -968,300 +956,293 @@
                                                                ColumnMetaData parameterMetaData,
                                                                int[][] lidAndLengths,
                                                                java.util.Hashtable overrideMap) throws SqlException {
-        int numVars = parameterMetaData.columns_;
-        String s = null;
-        if (!promototedParameters_.isEmpty()) {
-            promototedParameters_.clear();
-        }
-
-        for (int i = 0; i < numVars; i++) {
-
-            int jdbcType;
-            // Send the input type unless it is not available.
-            // (e.g an output parameter)
-            jdbcType = parameterMetaData.clientParamtertype_[i];
-            if (jdbcType == 0) {
-                jdbcType = parameterMetaData.types_[i];
+        try
+        {
+            int numVars = parameterMetaData.columns_;
+            String s = null;
+            if (!promototedParameters_.isEmpty()) {
+                promototedParameters_.clear();
             }
 
-            // jdbc semantics - This should happen outside of the build methods
-            // if describe input is not supported, we require the user to at least
-            // call setNull() and provide the type information.  Otherwise, we won't
-            // be able to guess the right PROTOCOL type to send to the server, and an
-            // exception is thrown.
+            for (int i = 0; i < numVars; i++) {
 
-            if (jdbcType == 0) {
-                throw new SqlException(netAgent_.logWriter_, "Invalid JDBC Type for parameter " + i);
-            }
+                int jdbcType;
+                // Send the input type unless it is not available.
+                // (e.g an output parameter)
+                jdbcType = parameterMetaData.clientParamtertype_[i];
+                if (jdbcType == 0) {
+                    jdbcType = parameterMetaData.types_[i];
+                }
+
+                // jdbc semantics - This should happen outside of the build methods
+                // if describe input is not supported, we require the user to at least
+                // call setNull() and provide the type information.  Otherwise, we won't
+                // be able to guess the right PROTOCOL type to send to the server, and an
+                // exception is thrown.
+
+                if (jdbcType == 0) {
+                    throw new SqlException(netAgent_.logWriter_, "Invalid JDBC Type for parameter " + i);
+                }
+
+                switch (jdbcType) {
+                case java.sql.Types.CHAR:
+                case java.sql.Types.VARCHAR:
+                    // lid: PROTOCOL_TYPE_NVARMIX, length override: 32767 (max)
+                    // dataFormat: String
+                    // this won't work if 1208 is not supported
+                    s = (String) inputRow[i];
+                    // assumes UTF-8 characters at most 3 bytes long
+                    // Flow the String as a VARCHAR
+                    if (s == null || s.length() <= 32767 / 3) {
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARMIX;
+                        lidAndLengths[i][1] = 32767;
+                    } else {
+                        // Flow the data as CLOB data if the data too large to for LONGVARCHAR
+                        java.io.ByteArrayInputStream bais = null;
+                        byte[] ba = null;
+                        try {
+                            ba = s.getBytes("UTF-8");
+                            bais = new java.io.ByteArrayInputStream(ba);
+                            Clob c = new Clob(netAgent_, bais, "UTF-8", ba.length);
+                            // inputRow[i] = c;
+                            // Place the new Lob in the promototedParameter_ collection for
+                            // NetStatementRequest use
+                            promototedParameters_.put(new Integer(i), c);
+
+                            lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
+                            lidAndLengths[i][1] = buildPlaceholderLength(c.length());
+                        } catch (java.io.UnsupportedEncodingException e) {
+                            throw new SqlException(netAgent_.logWriter_, e, "Error in building String parameter: throwable attached");
+                        }
+                    }
+                    break;
+                case java.sql.Types.INTEGER:
+                    // lid: PROTOCOL_TYPE_NINTEGER, length override: 4
+                    // dataFormat: Integer
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NINTEGER;
+                    lidAndLengths[i][1] = 4;
+                    break;
+                case java.sql.Types.BOOLEAN:
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NBOOLEAN;
+                    lidAndLengths[i][1] = 1;
+                    break;
+                case java.sql.Types.SMALLINT:
+                case java.sql.Types.TINYINT:
+                case java.sql.Types.BIT:
+                    // lid: PROTOCOL_TYPE_NSMALL,  length override: 2
+                    // dataFormat: Short
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NSMALL;
+                    lidAndLengths[i][1] = 2;
+                    break;
+                case java.sql.Types.REAL:
+                    // lid: PROTOCOL_TYPE_NFLOAT4, length override: 4
+                    // dataFormat: Float
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NFLOAT4;
+                    lidAndLengths[i][1] = 4;
+                    break;
+                case java.sql.Types.DOUBLE:
+                case java.sql.Types.FLOAT:
+                    // lid: PROTOCOL_TYPE_NFLOAT8, length override: 8
+                    // dataFormat: Double
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NFLOAT8;
+                    lidAndLengths[i][1] = 8;
+                    break;
+                case java.sql.Types.NUMERIC:
+                case java.sql.Types.DECIMAL:
+                    // lid: PROTOCOL_TYPE_NDECIMAL
+                    // dataFormat: java.math.BigDecimal
+                    // input only:
+                    //   if null and describe input - use describe input precision and scale
+                    //   if not null and describe input - calculate precision and actual scale from data
+                    //   if null and no describe input - guess with precision 1 scale 0
+                    //   if not null and no describe input - calculate precision and actual scale from data
+                    // output only:
+                    //   use largest precision/scale based on registered scale from registerOutParameter
+                    // inout:
+                    //   if null - use largest precision/scale based on scale from registerOutParameter
+                    //   if not null - write bigDecimal () pass registered scale so it can pad, you don't even
+                    //      have to look at the actual scale at this level.
+                    /*
+                    if (parameterMetaData.isGuessed) {
+                      java.math.BigDecimal bigDecimal = (java.math.BigDecimal) inputRow[i];
+                      int precision = Utils.computeBigDecimalPrecision (bigDecimal);
+                      lidAndLengths[i][1] = (precision << 8) + // use precision above
+                                          (bigDecimal.scale() << 0);
+                    }
+                    */
+                    // Split this entire method into two parts, the first method is called only once and the inputRow is not passed,!!
+                    // the second method is called for every inputRow and overrides inputDA lengths/scales based upon the acutal data!
+                    // for decimal and blob columns only
+                    int precision = parameterMetaData.sqlPrecision_[i];
+                    int scale = parameterMetaData.sqlScale_[i];
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NDECIMAL;
+                    lidAndLengths[i][1] = (precision << 8) + (scale << 0);
+                    break;
+                case java.sql.Types.DATE:
+                    // for input, output, and inout parameters
+                    // lid: PROTOCOL_TYPE_NDATE, length override: 8
+                    // dataFormat: java.sql.Date
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NDATE;
+                    lidAndLengths[i][1] = 10;
+                    break;
+                case java.sql.Types.TIME:
+                    // for input, output, and inout parameters
+                    // lid: PROTOCOL_TYPE_NTIME, length override: 8
+                    // dataFormat: java.sql.Time
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NTIME;
+                    lidAndLengths[i][1] = 8;
+                    break;
+                case java.sql.Types.TIMESTAMP:
+                    // for input, output, and inout parameters
+                    // lid: PROTOCOL_TYPE_NTIME, length overrid: 26
+                    // dataFormat: java.sql.Timestamp
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NTIMESTAMP;
+                    lidAndLengths[i][1] = 26;
+                    break;
+                case java.sql.Types.BIGINT:
+                    // if SQLAM < 6 this should be mapped to decimal (19,0) in common layer
+                    // if SQLAM >=6, lid: PROTOCOL_TYPE_NINTEGER8, length override: 8
+                    // dataFormat: Long
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NINTEGER8;
+                    lidAndLengths[i][1] = 8;
+                    break;
+                case java.sql.Types.LONGVARCHAR:
+                    // Is this the right thing to do  // should this be 32700
+                    s = (String) inputRow[i];
+                    if (s == null || s.length() <= 32767 / 3) {
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGMIX;
+                        lidAndLengths[i][1] = 32767;
+                    } else {
+                        // Flow the data as CLOB data if the data too large to for LONGVARCHAR
+                        java.io.ByteArrayInputStream bais = null;
+                        byte[] ba = null;
+                        try {
+                            ba = s.getBytes("UTF-8");
+                            bais = new java.io.ByteArrayInputStream(ba);
+                            Clob c = new Clob(netAgent_, bais, "UTF-8", ba.length);
+
+                            // inputRow[i] = c;
+                            // Place the new Lob in the promototedParameter_ collection for
+                            // NetStatementRequest use
+                            promototedParameters_.put(new Integer(i), c);
+
+                            lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
+                            lidAndLengths[i][1] = buildPlaceholderLength(c.length());
+                        } catch (java.io.UnsupportedEncodingException e) {
+                            throw new SqlException(netAgent_.logWriter_, e, "Error in building String parameter: throwable attached");
+                        }
+                    }
+                    break;
+                case java.sql.Types.BINARY:
+                case java.sql.Types.VARBINARY:
+                    byte[] ba = (byte[]) inputRow[i];
+                    if (ba == null) {
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARBYTE;
+                        lidAndLengths[i][1] = 32767;
+                    } else if (ba.length <= 32767) {
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARBYTE;
+                        lidAndLengths[i][1] = 32767;
+                    } else {
+                        // Promote to a BLOB. Only reach this path in the absence of describe information.
+                        Blob b = new Blob(ba, netAgent_, 0);
 
-            switch (jdbcType) {
-            case java.sql.Types.CHAR:
-            case java.sql.Types.VARCHAR:
-                // lid: PROTOCOL_TYPE_NVARMIX, length override: 32767 (max)
-                // dataFormat: String
-                // this won't work if 1208 is not supported
-                s = (String) inputRow[i];
-                // assumes UTF-8 characters at most 3 bytes long
-                // Flow the String as a VARCHAR
-                if (s == null || s.length() <= 32767 / 3) {
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARMIX;
-                    lidAndLengths[i][1] = 32767;
-                } else {
-                    // Flow the data as CLOB data if the data too large to for LONGVARCHAR
-                    java.io.ByteArrayInputStream bais = null;
-                    byte[] ba = null;
-                    try {
-                        ba = s.getBytes("UTF-8");
-                        bais = new java.io.ByteArrayInputStream(ba);
-                        Clob c = new Clob(netAgent_, bais, "UTF-8", ba.length);
-                        // inputRow[i] = c;
+                        // inputRow[i] = b;
                         // Place the new Lob in the promototedParameter_ collection for
                         // NetStatementRequest use
-                        promototedParameters_.put(new Integer(i), c);
+                        promototedParameters_.put(new Integer(i), b);
 
-                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
-                        lidAndLengths[i][1] = buildPlaceholderLength(c.length());
-                    } catch (java.io.UnsupportedEncodingException e) {
-                        throw new SqlException(netAgent_.logWriter_, e, "Error in building String parameter: throwable attached");
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
+                        lidAndLengths[i][1] = buildPlaceholderLength(ba.length);
                     }
-                }
-                break;
-            case java.sql.Types.INTEGER:
-                // lid: PROTOCOL_TYPE_NINTEGER, length override: 4
-                // dataFormat: Integer
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NINTEGER;
-                lidAndLengths[i][1] = 4;
-                break;
-            case java.sql.Types.BOOLEAN:
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NBOOLEAN;
-                lidAndLengths[i][1] = 1;
-                break;
-            case java.sql.Types.SMALLINT:
-            case java.sql.Types.TINYINT:
-            case java.sql.Types.BIT:
-                // lid: PROTOCOL_TYPE_NSMALL,  length override: 2
-                // dataFormat: Short
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NSMALL;
-                lidAndLengths[i][1] = 2;
-                break;
-            case java.sql.Types.REAL:
-                // lid: PROTOCOL_TYPE_NFLOAT4, length override: 4
-                // dataFormat: Float
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NFLOAT4;
-                lidAndLengths[i][1] = 4;
-                break;
-            case java.sql.Types.DOUBLE:
-            case java.sql.Types.FLOAT:
-                // lid: PROTOCOL_TYPE_NFLOAT8, length override: 8
-                // dataFormat: Double
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NFLOAT8;
-                lidAndLengths[i][1] = 8;
-                break;
-            case java.sql.Types.NUMERIC:
-            case java.sql.Types.DECIMAL:
-                // lid: PROTOCOL_TYPE_NDECIMAL
-                // dataFormat: java.math.BigDecimal
-                // input only:
-                //   if null and describe input - use describe input precision and scale
-                //   if not null and describe input - calculate precision and actual scale from data
-                //   if null and no describe input - guess with precision 1 scale 0
-                //   if not null and no describe input - calculate precision and actual scale from data
-                // output only:
-                //   use largest precision/scale based on registered scale from registerOutParameter
-                // inout:
-                //   if null - use largest precision/scale based on scale from registerOutParameter
-                //   if not null - write bigDecimal () pass registered scale so it can pad, you don't even
-                //      have to look at the actual scale at this level.
-                /*
-                if (parameterMetaData.isGuessed) {
-                  java.math.BigDecimal bigDecimal = (java.math.BigDecimal) inputRow[i];
-                  int precision = Utils.computeBigDecimalPrecision (bigDecimal);
-                  lidAndLengths[i][1] = (precision << 8) + // use precision above
-                                      (bigDecimal.scale() << 0);
-                }
-                */
-                // Split this entire method into two parts, the first method is called only once and the inputRow is not passed,!!
-                // the second method is called for every inputRow and overrides inputDA lengths/scales based upon the acutal data!
-                // for decimal and blob columns only
-                int precision = parameterMetaData.sqlPrecision_[i];
-                int scale = parameterMetaData.sqlScale_[i];
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NDECIMAL;
-                lidAndLengths[i][1] = (precision << 8) + (scale << 0);
-                break;
-            case java.sql.Types.DATE:
-                // for input, output, and inout parameters
-                // lid: PROTOCOL_TYPE_NDATE, length override: 8
-                // dataFormat: java.sql.Date
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NDATE;
-                lidAndLengths[i][1] = 10;
-                break;
-            case java.sql.Types.TIME:
-                // for input, output, and inout parameters
-                // lid: PROTOCOL_TYPE_NTIME, length override: 8
-                // dataFormat: java.sql.Time
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NTIME;
-                lidAndLengths[i][1] = 8;
-                break;
-            case java.sql.Types.TIMESTAMP:
-                // for input, output, and inout parameters
-                // lid: PROTOCOL_TYPE_NTIME, length overrid: 26
-                // dataFormat: java.sql.Timestamp
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NTIMESTAMP;
-                lidAndLengths[i][1] = 26;
-                break;
-            case java.sql.Types.BIGINT:
-                // if SQLAM < 6 this should be mapped to decimal (19,0) in common layer
-                // if SQLAM >=6, lid: PROTOCOL_TYPE_NINTEGER8, length override: 8
-                // dataFormat: Long
-                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NINTEGER8;
-                lidAndLengths[i][1] = 8;
-                break;
-            case java.sql.Types.LONGVARCHAR:
-                // Is this the right thing to do  // should this be 32700
-                s = (String) inputRow[i];
-                if (s == null || s.length() <= 32767 / 3) {
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGMIX;
-                    lidAndLengths[i][1] = 32767;
-                } else {
-                    // Flow the data as CLOB data if the data too large to for LONGVARCHAR
-                    java.io.ByteArrayInputStream bais = null;
-                    byte[] ba = null;
-                    try {
-                        ba = s.getBytes("UTF-8");
-                        bais = new java.io.ByteArrayInputStream(ba);
-                        Clob c = new Clob(netAgent_, bais, "UTF-8", ba.length);
+                    break;
+                case java.sql.Types.LONGVARBINARY:
+                    ba = (byte[]) inputRow[i];
+                    if (ba == null) {
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGVARBYTE;
+                        lidAndLengths[i][1] = 32767;
+                    } else if (ba.length <= 32767) {
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGVARBYTE;
+                        lidAndLengths[i][1] = 32767;
+                    } else {
+                        // Promote to a BLOB. Only reach this path in the absensce of describe information.
+                        Blob b = new Blob(ba, netAgent_, 0);
 
-                        // inputRow[i] = c;
+                        // inputRow[i] = b;
                         // Place the new Lob in the promototedParameter_ collection for
                         // NetStatementRequest use
-                        promototedParameters_.put(new Integer(i), c);
+                        promototedParameters_.put(new Integer(i), b);
 
-                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
-                        lidAndLengths[i][1] = buildPlaceholderLength(c.length());
-                    } catch (java.io.UnsupportedEncodingException e) {
-                        throw new SqlException(netAgent_.logWriter_, e, "Error in building String parameter: throwable attached");
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
+                        lidAndLengths[i][1] = buildPlaceholderLength(ba.length);
                     }
-                }
-                break;
-            case java.sql.Types.BINARY:
-            case java.sql.Types.VARBINARY:
-                byte[] ba = (byte[]) inputRow[i];
-                if (ba == null) {
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARBYTE;
-                    lidAndLengths[i][1] = 32767;
-                } else if (ba.length <= 32767) {
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARBYTE;
-                    lidAndLengths[i][1] = 32767;
-                } else {
-                    // Promote to a BLOB. Only reach this path in the absence of describe information.
-                    Blob b = new Blob(ba, netAgent_, 0);
-
-                    // inputRow[i] = b;
-                    // Place the new Lob in the promototedParameter_ collection for
-                    // NetStatementRequest use
-                    promototedParameters_.put(new Integer(i), b);
-
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
-                    lidAndLengths[i][1] = buildPlaceholderLength(ba.length);
-                }
-                break;
-            case java.sql.Types.LONGVARBINARY:
-                ba = (byte[]) inputRow[i];
-                if (ba == null) {
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGVARBYTE;
-                    lidAndLengths[i][1] = 32767;
-                } else if (ba.length <= 32767) {
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGVARBYTE;
-                    lidAndLengths[i][1] = 32767;
-                } else {
-                    // Promote to a BLOB. Only reach this path in the absensce of describe information.
-                    Blob b = new Blob(ba, netAgent_, 0);
-
-                    // inputRow[i] = b;
-                    // Place the new Lob in the promototedParameter_ collection for
-                    // NetStatementRequest use
-                    promototedParameters_.put(new Integer(i), b);
-
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
-                    lidAndLengths[i][1] = buildPlaceholderLength(ba.length);
-                }
-                break;
-            case java.sql.Types.BLOB:
-                java.sql.Blob b = (java.sql.Blob) inputRow[i];
-                if (b == null) {
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
-                    lidAndLengths[i][1] =
-                            buildPlaceholderLength(parameterMetaData.sqlLength_[i]);
-                } else {
-                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
-                    try {
-                        lidAndLengths[i][1] = buildPlaceholderLength(b.length());
-                    } catch (java.sql.SQLException e) {
-                        if (!(e instanceof org.apache.derby.client.am.SqlException)) {
-                            SqlException toThrow =
-                                    new SqlException(netAgent_.logWriter_, "Error obtaining length of external blob object, exception follows. ");
-                            toThrow.setNextException(e);
-                            throw toThrow;
-                        } else {
+                    break;
+                case java.sql.Types.BLOB:
+                    java.sql.Blob b = (java.sql.Blob) inputRow[i];
+                    if (b == null) {
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
+                        lidAndLengths[i][1] =
+                                buildPlaceholderLength(parameterMetaData.sqlLength_[i]);
+                    } else {
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
+                        try {
+                            lidAndLengths[i][1] = buildPlaceholderLength(b.length());
+                        } catch (java.sql.SQLException e) {
                             throw new SqlException(netAgent_.logWriter_, e, "Error obtaining length of blob object, exception follows. ");
                         }
                     }
-                }
-                break;
-            case java.sql.Types.CLOB:
-                {
-                    // use columnMeta.singleMixedByteOrDouble_ to decide protocolType
-                    java.sql.Clob c = (java.sql.Clob) inputRow[i];
-                    boolean isExternalClob = !(c instanceof org.apache.derby.client.am.Clob);
-                    long lobLength = 0;
-                    if (c == null) {
-                        lobLength = parameterMetaData.sqlLength_[i];
-                    } else if (isExternalClob) {
-                        try {
-                            lobLength = c.length();
-                        } catch (java.sql.SQLException e) {
-                            if (!(e instanceof org.apache.derby.client.am.SqlException)) {
-                                SqlException toThrow =
-                                        new SqlException(netAgent_.logWriter_, "Error obtaining length of external clob object, exception follows. ");
-                                toThrow.setNextException(e);
-                                throw toThrow;
-                            } else {
+                    break;
+                case java.sql.Types.CLOB:
+                    {
+                        // use columnMeta.singleMixedByteOrDouble_ to decide protocolType
+                        java.sql.Clob c = (java.sql.Clob) inputRow[i];
+                        boolean isExternalClob = !(c instanceof org.apache.derby.client.am.Clob);
+                        long lobLength = 0;
+                        if (c == null) {
+                            lobLength = parameterMetaData.sqlLength_[i];
+                        } else if (isExternalClob) {
+                            try {
+                                lobLength = c.length();
+                            } catch (java.sql.SQLException e) {
                                 throw new SqlException(netAgent_.logWriter_, e, "Error obtaining length of clob object, exception follows. ");
                             }
+                        } else {
+                            lobLength = ((Clob) c).length();
+                        }
+                        if (c == null) {
+                            lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
+                            lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
+                        } else if (isExternalClob) {
+                            lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCDBCS;
+                            lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
+                        } else if (((Clob) c).isCharacterStream()) {
+                            lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCDBCS;
+                            lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
+                        } else if (((Clob) c).isUnicodeStream()) {
+                            lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
+                            lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
+                        } else if (((Clob) c).isAsciiStream()) {
+                            lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCSBCS;
+                            lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
+                        } else if (((Clob) c).isString()) {
+                            lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
+                            lidAndLengths[i][1] = buildPlaceholderLength(((Clob) c).getUTF8Length());
                         }
-                    } else {
-                        lobLength = ((Clob) c).length();
-                    }
-                    if (c == null) {
-                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
-                        lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
-                    } else if (isExternalClob) {
-                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCDBCS;
-                        lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
-                    } else if (((Clob) c).isCharacterStream()) {
-                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCDBCS;
-                        lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
-                    } else if (((Clob) c).isUnicodeStream()) {
-                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
-                        lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
-                    } else if (((Clob) c).isAsciiStream()) {
-                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCSBCS;
-                        lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
-                    } else if (((Clob) c).isString()) {
-                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
-                        lidAndLengths[i][1] = buildPlaceholderLength(((Clob) c).getUTF8Length());
                     }
+                    break;
+                default :
+                    throw new SqlException(netAgent_.logWriter_, "unrecognized sql type");
                 }
-                break;
-            default :
-                throw new SqlException(netAgent_.logWriter_, "unrecognized sql type");
-            }
 
-            if (!parameterMetaData.nullable_[i]) {
-                lidAndLengths[i][0]--;
+                if (!parameterMetaData.nullable_[i]) {
+                    lidAndLengths[i][0]--;
+                }
             }
+            return overrideMap;
+        }
+        catch ( java.sql.SQLException se )
+        {
+            throw new SqlException(se);
         }
-        return overrideMap;
     }
 
     private int buildPlaceholderLength(long totalLength) {

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java?rev=371561&r1=371560&r2=371561&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java Mon Jan 23 07:58:34 2006
@@ -20,6 +20,8 @@
 
 package org.apache.derby.client.net;
 
+import java.sql.SQLException;
+
 import javax.transaction.xa.Xid;
 
 import org.apache.derby.client.am.SqlException;
@@ -197,7 +199,7 @@
         }
     }
 
-    synchronized public void close() throws SqlException {
+    synchronized public void close() throws SQLException {
         // call super.close*() to do the close*
         super.close();
         if (open_) {
@@ -208,7 +210,7 @@
         }
     }
 
-    synchronized public void closeX() throws SqlException {
+    synchronized public void closeX() throws SQLException {
         // call super.close*() to do the close*
         super.closeX();
         if (open_) {
@@ -230,7 +232,7 @@
         }
     }
 
-    synchronized public void closeResources() throws SqlException {
+    synchronized public void closeResources() throws SQLException {
         // call super.close*() to do the close*
         super.closeResources();
         if (open_) {

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java?rev=371561&r1=371560&r2=371561&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java Mon Jan 23 07:58:34 2006
@@ -359,7 +359,7 @@
     /**
      * Not an external.  Do not document in pubs. Populates member data for this data source given a JNDI reference.
      */
-    public void hydrateFromReference(Reference ref) throws SQLException {
+    public void hydrateFromReference(Reference ref) throws SqlException {
     	
         RefAddr address;
 
@@ -437,7 +437,7 @@
     /**
      * Not an external.  Do not document in pubs. Returns all non-transient properties of a ClientBaseDataSource.
      */
-    public Properties getProperties() throws SQLException {
+    public Properties getProperties() throws SqlException {
         Properties properties = new Properties();
 
         Class clz = getClass();

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java?rev=371561&r1=371560&r2=371561&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java Mon Jan 23 07:58:34 2006
@@ -26,6 +26,7 @@
 
 import org.apache.derby.client.ClientPooledConnection;
 import org.apache.derby.client.am.LogWriter;
+import org.apache.derby.client.am.SqlException;
 
 /**
  * ClientConnectionPoolDataSource is a factory for PooledConnection objects. An object that implements this interface
@@ -43,28 +44,42 @@
 
     // Attempt to establish a physical database connection that can be used as a pooled connection.
     public PooledConnection getPooledConnection() throws SQLException {
-        LogWriter dncLogWriter = super.computeDncLogWriterForNewConnection("_cpds");
-        if (dncLogWriter != null) {
-            dncLogWriter.traceEntry(this, "getPooledConnection");
+        try
+        {
+            LogWriter dncLogWriter = super.computeDncLogWriterForNewConnection("_cpds");
+            if (dncLogWriter != null) {
+                dncLogWriter.traceEntry(this, "getPooledConnection");
+            }
+            PooledConnection pooledConnection = getPooledConnectionX(dncLogWriter, this, getUser(), getPassword());
+            if (dncLogWriter != null) {
+                dncLogWriter.traceExit(this, "getPooledConnection", pooledConnection);
+            }
+            return pooledConnection;
         }
-        PooledConnection pooledConnection = getPooledConnectionX(dncLogWriter, this, getUser(), getPassword());
-        if (dncLogWriter != null) {
-            dncLogWriter.traceExit(this, "getPooledConnection", pooledConnection);
+        catch ( SqlException se )
+        {
+            throw se.getSQLException();
         }
-        return pooledConnection;
     }
 
     // Standard method that establishes the initial physical connection using CPDS properties.
     public PooledConnection getPooledConnection(String user, String password) throws SQLException {
-        LogWriter dncLogWriter = super.computeDncLogWriterForNewConnection("_cpds");
-        if (dncLogWriter != null) {
-            dncLogWriter.traceEntry(this, "getPooledConnection", user, "<escaped>");
+        try
+        {
+            LogWriter dncLogWriter = super.computeDncLogWriterForNewConnection("_cpds");
+            if (dncLogWriter != null) {
+                dncLogWriter.traceEntry(this, "getPooledConnection", user, "<escaped>");
+            }
+            PooledConnection pooledConnection = getPooledConnectionX(dncLogWriter, this, user, password);
+            if (dncLogWriter != null) {
+                dncLogWriter.traceExit(this, "getPooledConnection", pooledConnection);
+            }
+            return pooledConnection;
         }
-        PooledConnection pooledConnection = getPooledConnectionX(dncLogWriter, this, user, password);
-        if (dncLogWriter != null) {
-            dncLogWriter.traceExit(this, "getPooledConnection", pooledConnection);
+        catch ( SqlException se )
+        {
+            throw se.getSQLException();
         }
-        return pooledConnection;
     }
 
     //  method that establishes the initial physical connection

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource.java?rev=371561&r1=371560&r2=371561&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource.java Mon Jan 23 07:58:34 2006
@@ -25,6 +25,7 @@
 import javax.sql.DataSource;
 
 import org.apache.derby.client.am.LogWriter;
+import org.apache.derby.client.am.SqlException;
 import org.apache.derby.client.net.NetConnection;
 import org.apache.derby.client.net.NetLogWriter;
 
@@ -146,14 +147,21 @@
      * @throws java.sql.SQLException if a database-access error occurs.
      */
     public Connection getConnection(String user, String password) throws SQLException {
-        // Jdbc 2 connections will write driver trace info on a
-        // datasource-wide basis using the jdbc 2 data source log writer.
-        // This log writer may be narrowed to the connection-level
-        // This log writer will be passed to the agent constructor.
-
-        LogWriter dncLogWriter = super.computeDncLogWriterForNewConnection("_sds");
-        updateDataSourceValues(tokenizeAttributes(getConnectionAttributes(), null));
-        return new NetConnection((NetLogWriter) dncLogWriter, user, password, this, -1, false);
+        try
+        {
+            // Jdbc 2 connections will write driver trace info on a
+            // datasource-wide basis using the jdbc 2 data source log writer.
+            // This log writer may be narrowed to the connection-level
+            // This log writer will be passed to the agent constructor.
+
+            LogWriter dncLogWriter = super.computeDncLogWriterForNewConnection("_sds");
+            updateDataSourceValues(tokenizeAttributes(getConnectionAttributes(), null));
+            return new NetConnection((NetLogWriter) dncLogWriter, user, password, this, -1, false);
+        }
+        catch ( SqlException se )
+        {
+            throw se.getSQLException();
+        }
     }
 
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java?rev=371561&r1=371560&r2=371561&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java Mon Jan 23 07:58:34 2006
@@ -22,6 +22,7 @@
 
 import java.util.Enumeration;
 import java.util.Properties;
+import java.sql.SQLException;
 
 import org.apache.derby.client.am.Configuration;
 import org.apache.derby.client.am.ResourceUtilities;
@@ -36,7 +37,7 @@
 
     private final static int DERBY_REMOTE_PROTOCOL = 1;
 
-    static private SqlException exceptionsOnLoadDriver__ = null;
+    static private SQLException exceptionsOnLoadDriver__ = null;
     // Keep track of the registere driver so that we can deregister it if we're a stored proc.
     static private ClientDriver registeredDriver__ = null;
 
@@ -45,7 +46,8 @@
         // The Configuration static clause should execute before the following line does.
         if (Configuration.exceptionsOnLoadResources != null) {
             exceptionsOnLoadDriver__ =
-                    Utils.accumulateSQLException(Configuration.exceptionsOnLoadResources,
+                    Utils.accumulateSQLException(
+                            Configuration.exceptionsOnLoadResources.getSQLException(),
                             exceptionsOnLoadDriver__);
         }
         try {
@@ -54,7 +56,7 @@
         } catch (java.sql.SQLException e) {
             // A null log writer is passed, because jdbc 1 sql exceptions are automatically traced
             exceptionsOnLoadDriver__ =
-                    new SqlException(null, "Error occurred while trying to register Dnc driver with JDBC 1 Driver Manager");
+                    new SqlException(null, "Error occurred while trying to register Dnc driver with JDBC 1 Driver Manager").getSQLException();
             exceptionsOnLoadDriver__.setNextException(e);
         }
     }
@@ -64,76 +66,83 @@
 
     public java.sql.Connection connect(String url,
                                        java.util.Properties properties) throws java.sql.SQLException {
-        if (exceptionsOnLoadDriver__ != null) {
-            throw exceptionsOnLoadDriver__;
-        }
+        try
+        {
+            if (exceptionsOnLoadDriver__ != null) {
+                throw exceptionsOnLoadDriver__;
+            }
 
-        if (properties == null) {
-            properties = new java.util.Properties();
-        }
+            if (properties == null) {
+                properties = new java.util.Properties();
+            }
 
-        java.util.StringTokenizer urlTokenizer =
-                new java.util.StringTokenizer(url, "/:= \t\n\r\f", true);
+            java.util.StringTokenizer urlTokenizer =
+                    new java.util.StringTokenizer(url, "/:= \t\n\r\f", true);
 
-        int protocol = tokenizeProtocol(url, urlTokenizer);
-        if (protocol == 0) {
-            return null; // unrecognized database URL prefix.
-        }
+            int protocol = tokenizeProtocol(url, urlTokenizer);
+            if (protocol == 0) {
+                return null; // unrecognized database URL prefix.
+            }
+
+            String slashOrNull = null;
+            if (protocol == DERBY_REMOTE_PROTOCOL) {
+                try {
+                    slashOrNull = urlTokenizer.nextToken(":/");
+                } catch (java.util.NoSuchElementException e) {
+                    // A null log writer is passed, because jdbc 1 sqlexceptions are automatically traced
+                    throw new SqlException(null, e, "Invalid database url syntax: " + url);
+                }
+            }
+            String server = tokenizeServerName(urlTokenizer, url);    // "/server"
+            int port = tokenizeOptionalPortNumber(urlTokenizer, url); // "[:port]/"
+            if (port == 0) {
+                port = ClientDataSource.propertyDefault_portNumber;
+            }
+
+            // database is the database name and attributes.  This will be
+            // sent to network server as the databaseName
+            String database = tokenizeDatabase(urlTokenizer, url); // "database"
+            java.util.Properties augmentedProperties = tokenizeURLProperties(url, properties);
+            database = appendDatabaseAttributes(database,augmentedProperties);
 
-        String slashOrNull = null;
-        if (protocol == DERBY_REMOTE_PROTOCOL) {
+            int traceLevel;
             try {
-                slashOrNull = urlTokenizer.nextToken(":/");
-            } catch (java.util.NoSuchElementException e) {
+                traceLevel = ClientDataSource.getTraceLevel(augmentedProperties);
+            } catch (java.lang.NumberFormatException e) {
                 // A null log writer is passed, because jdbc 1 sqlexceptions are automatically traced
-                throw new SqlException(null, e, "Invalid database url syntax: " + url);
+                throw new SqlException(null, e, "trouble reading traceLevel connection property");
             }
-        }
-        String server = tokenizeServerName(urlTokenizer, url);    // "/server"
-        int port = tokenizeOptionalPortNumber(urlTokenizer, url); // "[:port]/"
-        if (port == 0) {
-            port = ClientDataSource.propertyDefault_portNumber;
-        }
 
-        // database is the database name and attributes.  This will be
-        // sent to network server as the databaseName
-        String database = tokenizeDatabase(urlTokenizer, url); // "database"
-        java.util.Properties augmentedProperties = tokenizeURLProperties(url, properties);
-        database = appendDatabaseAttributes(database,augmentedProperties);
-
-        int traceLevel;
-        try {
-            traceLevel = ClientDataSource.getTraceLevel(augmentedProperties);
-        } catch (java.lang.NumberFormatException e) {
-            // A null log writer is passed, because jdbc 1 sqlexceptions are automatically traced
-            throw new SqlException(null, e, "trouble reading traceLevel connection property");
-        }
-
-        // Jdbc 1 connections will write driver trace info on a
-        // driver-wide basis using the jdbc 1 driver manager log writer.
-        // This log writer may be narrowed to the connection-level
-        // This log writer will be passed to the agent constructor.
-        org.apache.derby.client.am.LogWriter dncLogWriter =
-                ClientDataSource.computeDncLogWriterForNewConnection(java.sql.DriverManager.getLogWriter(),
-                        ClientDataSource.getTraceDirectory(augmentedProperties),
-                        ClientDataSource.getTraceFile(augmentedProperties),
-                        ClientDataSource.getTraceFileAppend(augmentedProperties),
-                        traceLevel,
-                        "_driver",
-                        traceFileSuffixIndex_++);
-
-        org.apache.derby.client.net.NetConnection conn =
-                new org.apache.derby.client.net.NetConnection((org.apache.derby.client.net.NetLogWriter) dncLogWriter,
-                        java.sql.DriverManager.getLoginTimeout(),
-                        server,
-                        port,
-                        database,
-                        augmentedProperties);
-        
-        if(conn.isConnectionNull())
-        	return null;
-        
-        return conn;
+            // Jdbc 1 connections will write driver trace info on a
+            // driver-wide basis using the jdbc 1 driver manager log writer.
+            // This log writer may be narrowed to the connection-level
+            // This log writer will be passed to the agent constructor.
+            org.apache.derby.client.am.LogWriter dncLogWriter =
+                    ClientDataSource.computeDncLogWriterForNewConnection(java.sql.DriverManager.getLogWriter(),
+                            ClientDataSource.getTraceDirectory(augmentedProperties),
+                            ClientDataSource.getTraceFile(augmentedProperties),
+                            ClientDataSource.getTraceFileAppend(augmentedProperties),
+                            traceLevel,
+                            "_driver",
+                            traceFileSuffixIndex_++);
+
+            org.apache.derby.client.net.NetConnection conn =
+                    new org.apache.derby.client.net.NetConnection((org.apache.derby.client.net.NetLogWriter) dncLogWriter,
+                            java.sql.DriverManager.getLoginTimeout(),
+                            server,
+                            port,
+                            database,
+                            augmentedProperties);
+
+            if(conn.isConnectionNull())
+                return null;
+
+            return conn;
+        }
+        catch ( SqlException se )
+        {
+            throw se.getSQLException();
+        }
     }
 
     /**
@@ -161,10 +170,17 @@
 	}
 
 	public boolean acceptsURL(String url) throws java.sql.SQLException {
-        java.util.StringTokenizer urlTokenizer = 
-        		new java.util.StringTokenizer(url, "/:=; \t\n\r\f", true);
-        int protocol = tokenizeProtocol(url, urlTokenizer);
-        return protocol != 0;
+        try
+        {
+            java.util.StringTokenizer urlTokenizer = 
+                    new java.util.StringTokenizer(url, "/:=; \t\n\r\f", true);
+            int protocol = tokenizeProtocol(url, urlTokenizer);
+            return protocol != 0;
+        }
+        catch ( SqlException se )
+        {
+            throw se.getSQLException();
+        }
     }
 
     public java.sql.DriverPropertyInfo[] getPropertyInfo(String url,

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java?rev=371561&r1=371560&r2=371561&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java Mon Jan 23 07:58:34 2006
@@ -26,6 +26,7 @@
 
 import org.apache.derby.client.ClientXAConnection;
 import org.apache.derby.client.net.NetLogWriter;
+import org.apache.derby.client.am.SqlException;
 
 
 public class ClientXADataSource extends ClientDataSource implements XADataSource {
@@ -43,7 +44,14 @@
     }
 
     public XAConnection getXAConnection(String user, String password) throws SQLException {
-        NetLogWriter dncLogWriter = (NetLogWriter) super.computeDncLogWriterForNewConnection("_xads");
-        return new ClientXAConnection(this, dncLogWriter, user, password);
+        try
+        {
+            NetLogWriter dncLogWriter = (NetLogWriter) super.computeDncLogWriterForNewConnection("_xads");
+            return new ClientXAConnection(this, dncLogWriter, user, password);
+        }
+        catch ( SqlException se )
+        {
+            throw se.getSQLException();
+        }
     }
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out?rev=371561&r1=371560&r2=371561&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out Mon Jan 23 07:58:34 2006
@@ -1,16 +1,16 @@
-get stream from SMALL_BLOB_TABLE.SMALL_BLOB ...
-get stream from SMALL_BLOB_TABLE.SMALL_BLOB again ...
-Expected exception may happen.
-org.apache.derby.client.am.SqlException: Stream of column value in result cannot be retrieved twice
-get stream from LARGE_BLOB_TABLE.LARGE_BLOB ...
-get stream from LARGE_BLOB_TABLE.LARGE_BLOB again ...
-Expected exception may happen.
-org.apache.derby.client.am.SqlException: Stream of column value in result cannot be retrieved twice
-get reader from SMALL_CLOB_TABLE.SMALL_CLOB ...
-get reader from SMALL_CLOB_TABLE.SMALL_CLOBagain ...
-Expected exception may happen.
-org.apache.derby.client.am.SqlException: Stream of column value in result cannot be retrieved twice
-get reader from LARGE_CLOB_TABLE.LARGE_CLOB ...
-get reader from LARGE_CLOB_TABLE.LARGE_CLOBagain ...
-Expected exception may happen.
-org.apache.derby.client.am.SqlException: Stream of column value in result cannot be retrieved twice
+get stream from SMALL_BLOB_TABLE.SMALL_BLOB ...
+get stream from SMALL_BLOB_TABLE.SMALL_BLOB again ...
+Expected exception may happen.
+java.sql.SQLException: Stream of column value in result cannot be retrieved twice
+get stream from LARGE_BLOB_TABLE.LARGE_BLOB ...
+get stream from LARGE_BLOB_TABLE.LARGE_BLOB again ...
+Expected exception may happen.
+java.sql.SQLException: Stream of column value in result cannot be retrieved twice
+get reader from SMALL_CLOB_TABLE.SMALL_CLOB ...
+get reader from SMALL_CLOB_TABLE.SMALL_CLOBagain ...
+Expected exception may happen.
+java.sql.SQLException: Stream of column value in result cannot be retrieved twice
+get reader from LARGE_CLOB_TABLE.LARGE_CLOB ...
+get reader from LARGE_CLOB_TABLE.LARGE_CLOBagain ...
+Expected exception may happen.
+java.sql.SQLException: Stream of column value in result cannot be retrieved twice



Mime
View raw message