Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7067320

ResultSet.wasNull() does not return true after reading null value

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P5
    • Resolution: Future Project
    • Affects Version/s: 7
    • Fix Version/s: 5.0
    • Component/s: core-libs
    • Labels:

      Description

      SYNOPSIS
      --------
      ResultSet.wasNull() does not return true after reading null value

      FULL JDK VERSION
      ----------------
      Java 6 (tested with 6u26)
      Also reproducible on 5.0 and JDK 7 (b147)

      OPERATING SYSTEM
      ----------------
      Reported on Windows XP
      (Linux/Solaris not tested)


      PROBLEM DESCRIPTION from LICENSEE
      ---------------------------------
      While reading a NULL value from the database using the JDBC-ODBC bridge, ResultSet.getString(), calling ResultSet.wasNull() returns false. It should return true.

      CR 4424215 seems to describe a similar issue, but it was reported against 1.3.0 and fixed in 1.3.1. However, we are currently seeing the same issue in Java 6 (we also see the problem with 5.0)

      REPRODUCTION INSTRUCTIONS
      -------------------------
      This testcase requires a functioning ODBC configuration.

      1. Edit the testcase (specifically, line 15) to ensure that it
         correlates with you local ODBC configuration.
      2. Compile and run the testcase.

      Observed output (using JDBC-ODBC bridge):

          URL = "jdbc:odbc:TOOLSDB;UID=xxxxxxxx;PWD=xxxxxxxx"
          CLOB wasNull: true
          BLOB wasNull: false length of data: -1 <-- problem
          CLOB wasNull: false length of data: -1 <-- problem
          BLOB wasNull: false length of data: 255

      Expected output (using DB2 JDBC driver):

          URL = "jdbc:odbc:ora92_gimli;UID=************;PWD=******"
          CLOB wasNull: true
          BLOB wasNull: true
          CLOB wasNull: false length of data: 255
          BLOB wasNull: false length of data: 255

      TESTCASE
      --------
      Testcase attached. Issue is highlighted at line 206-212.

      WORKAROUND
      ----------
      Use another JDBC driver, such as DB2.

        Attachments

          Activity

            People

            • Assignee:
              lancea Lance Andersen
              Reporter:
              dkorbel David Korbel (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: