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

Changes needed to Types.java for new datatypes to avoid collisions with Oracle data types

XMLWordPrintable

    • b98
    • generic
    • generic

      JDBC defines a bunch of int constants in java.sql.Types. These ints
      are used as arguments to assorted methods like getObject and
      registerOutParameter. Oracle defines some additional int constants in
      oracle.jdbc.OracleTypes that identify Oracle specific types. The JDBC
      4.0 spec defines six new types. Unfortunately the int values chosen
      for four of those new types conflict with values defined in
      OracleTypes. Since ints are ints, there is no way to distinguish
      between them. The driver cannot tell the difference between

         s.registerOutParameter(n, Types.NCHAR);

      and

        s.registerOutParameter(n, OracleTypes.ROWID);

      The two have the same int value.







      The following redefinitions of the
      java.sql.Types constants that avoid any incompatibility with OracleTypes.


       public final static int NCHAR = -15; // was -8
       public final static int NCLOB = 2011; // was 2007
       public final static int NVARCHAR = -9; // ok
       public final static int LONGNVARCHAR = -16; // was -10
       public final static int ROWID = -8; // was 2008
       public final static int SQLXML = 2009; // ok

            lancea Lance Andersen
            lancea Lance Andersen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: