Derby
  1. Derby
  2. DERBY-21

ResultsetMetaData.getColumnClassName() for CLOB and BLOB datatypes is incorrect.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.0.2.0
    • Fix Version/s: 10.0.2.0
    • Component/s: JDBC
    • Labels:
      None

      Description

      Opening this bug on behalf of Daniel Debrunner.

      -------------------------------------------------------------
      ResultsetMetaData.getColumnClassName() for CLOB and BLOB
      datatypes is incorrect.
      BLOB: CLOB:
      jcc: java.sql.Blob java.sql.Clob
      Derby: byte[] java.lang.String

      Derby's embedded JDBC driver returns the incorrect class
      names for BLOB and CLOB columns in a ResultSet when using the
      ResultSetMetaData.getColumnClassName() method. Note that the
      ResultSet.getObject() method calls are not currently supported
      for BLOB and CLOB.

        Activity

        Hide
        Amit Handa added a comment -

        The EmbeddedResultSetMetaData.getColumnClassName
        calls TypeId.getResultSetMetaDataTypeName() as shown :-

        Class Name :/java/engine/org/apache/derby/iapi/types/TypeId.java
        Method : getResultSetMetaDataTypeName

        public String getResultSetMetaDataTypeName()
        {
        if (BLOB_ID == this)

        { return "java.sql.Blob"; }
        if (CLOB_ID == this){ return "java.sql.Clob"; }
        if (NCLOB_ID == this) { return "java.sql.Clob"; }
        return getCorrespondingJavaTypeName();
        }


        Rather it should be

        public String getResultSetMetaDataTypeName()
        {
        if (BLOB_ID.equals(this)){ return "java.sql.Blob"; }

        if (CLOB_ID.equals(this))

        { return "java.sql.Clob"; }
        if (NCLOB_ID.equals(this)) { return "java.sql.Clob"; }

        }

        Show
        Amit Handa added a comment - The EmbeddedResultSetMetaData.getColumnClassName calls TypeId.getResultSetMetaDataTypeName() as shown :- Class Name :/java/engine/org/apache/derby/iapi/types/TypeId.java Method : getResultSetMetaDataTypeName public String getResultSetMetaDataTypeName() { if (BLOB_ID == this) { return "java.sql.Blob"; } if (CLOB_ID == this){ return "java.sql.Clob"; } if (NCLOB_ID == this) { return "java.sql.Clob"; } return getCorrespondingJavaTypeName(); } Rather it should be public String getResultSetMetaDataTypeName() { if (BLOB_ID.equals(this)){ return "java.sql.Blob"; } if (CLOB_ID.equals(this)) { return "java.sql.Clob"; } if (NCLOB_ID.equals(this)) { return "java.sql.Clob"; } }
        Hide
        Satheesh Bandaram added a comment -

        Submitted this patch. Thanks, Amit.

        Satheesh

        Sending java\engine\org\apache\derby\iapi\types\TypeId.java
        Transmitting file data .
        Committed revision 106336.

        Show
        Satheesh Bandaram added a comment - Submitted this patch. Thanks, Amit. Satheesh Sending java\engine\org\apache\derby\iapi\types\TypeId.java Transmitting file data . Committed revision 106336.
        Hide
        Satheesh Bandaram added a comment -

        Fix has been submitted.

        Show
        Satheesh Bandaram added a comment - Fix has been submitted.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ramandeep Kaur
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development