Derby
  1. Derby
  2. DERBY-5042

ResultSet.updateBoolean() on new BOOLEAN type throws exception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1
    • Fix Version/s: 10.8.1.2
    • Component/s: Network Client
    • Labels:
      None
    • Environment:
      OS X 10.6.5, Java 1.6
    • Bug behavior facts:
      Embedded/Client difference

      Description

      I am encountering an error trying to update a BOOLEAN type through an
      updatable ResultSet. My table looks like this:

      CREATE TABLE file_store (
      path VARCHAR(255) NOT NULL,
      network VARCHAR(32) NOT NULL,
      file_blob BLOB,
      file_md5 VARCHAR(32),
      is_directory BOOLEAN NOT NULL DEFAULT false,
      PRIMARY KEY (path, network)
      );

      My SQL looks like this:

      SELECT path, network, is_directory FROM file_store
      WHERE path=? AND network=? AND is_directory=true FOR UPDATE OF path, network, is_directory

      My Java code looks like this:

      ...
      resultSet.moveToInsertRow();
      resultSet.updateString("path", dirPath);
      resultSet.updateString("network", network);
      resultSet.updateBoolean("is_directory", true);
      resultSet.insertRow();

      An exception is thrown in the call to updateBoolean() as follows:

      java.sql.SQLException: An attempt was made to put a data value of type 'byte' into a data value of type 'BOOLEAN'.

      It's a shame, I was looking forward to using the new BOOLEAN type before I roll out the next version of our software. For now I will fallback to SMALLINT. Does/will ALTER TABLE support a change from SMALLINT to BOOLEAN?

      1. derby-5042-1a.diff
        3 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Brett Wooldridge created issue -
          Nirmal Fernando made changes -
          Field Original Value New Value
          Assignee C.S. Nirmal J. Fernando [ nirmal ]
          Knut Anders Hatlen made changes -
          Bug behavior facts [Embedded/Client difference]
          Component/s Network Client [ 11690 ]
          Knut Anders Hatlen made changes -
          Link This issue is related to DERBY-5058 [ DERBY-5058 ]
          Nirmal Fernando made changes -
          Assignee C.S. Nirmal J. Fernando [ nirmal ]
          Knut Anders Hatlen made changes -
          Assignee Knut Anders Hatlen [ knutanders ]
          Knut Anders Hatlen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Knut Anders Hatlen made changes -
          Attachment derby-5042-1a.diff [ 12471763 ]
          Knut Anders Hatlen made changes -
          Issue & fix info [Patch Available]
          Knut Anders Hatlen made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Issue & fix info [Patch Available]
          Fix Version/s 10.8.0.0 [ 12315561 ]
          Resolution Fixed [ 1 ]
          Rick Hillegas made changes -
          Fix Version/s 10.8.1.1 [ 12316356 ]
          Fix Version/s 10.8.1.0 [ 12315561 ]
          Rick Hillegas made changes -
          Fix Version/s 10.8.1.1 [ 12316356 ]
          Fix Version/s 10.8.1.2 [ 12316362 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12552962 ] Default workflow, editable Closed status [ 12802713 ]

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Brett Wooldridge
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development