JDK-6462628 : Changes needed to Types.java for new datatypes to avoid collisions with Oracle data types
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.sql
  • Affected Version: cts_5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-08-22
  • Updated: 2011-02-16
  • Resolved: 2006-08-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b98Fixed
Related Reports
Relates :  
Description
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

Comments
EVALUATION changes have been made to Types.java
23-08-2006

EVALUATION Must be done for GA
22-08-2006