Commons DbUtils
  1. Commons DbUtils
  2. DBUTILS-26

[dbutils] Oracle 9.2.0 JDBC Timestamp Problem

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: 1.1
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

      Description

      I just run into a Timestamp problem with the Oracle 9i (9.2.0) JDBC Driver.

      When calling rs.getObject(index) on a DB field, defined as Timestamp(6),
      the resulting object is a oracle.sql.TIMESTAMP and not a java.sql.Timestamp as
      with other JDBC Drivers.

      This leads to a null value propagation if your Bean Property is defined as
      java.sql.Timestamp.

      If calling rs.getTimestamp(index), Oracle correctly converts the
      resulting value to a java.sql.Timestamp object.

      The following addition to the processColumn Method of the BeanProcessor class
      whould solve the problem.

      } else if(propType.equals(Timestamp.class)) {
      return rs.getTimestamp(index);

      This ensures that for a Bean property of type java.sql.Timestamp the
      getTimestamp() method is called.
      Otherwise the default getObject() mehod is called, so there souldn't be
      a problem if someone wants the Oracle enhanced oracle.sql.TIMESTAMP
      object.

      Regards
      Rolf

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Resolved Resolved Closed Closed
        1230d 14h 21m 1 Henri Yandell 02/Jan/08 07:29
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Fix Version/s 1.1 [ 12311973 ]
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311745 ]
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311648 ]
        Project Commons [ 12310458 ] Commons DbUtils [ 12310470 ]
        Key COM-1498 DBUTILS-26
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Component/s DbUtils [ 12311110 ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 30749 12341650
        Hide
        David Graham added a comment -

        Fixed in the next nightly build.

        Show
        David Graham added a comment - Fixed in the next nightly build.
        Rolf Moser created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Rolf Moser
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development