United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6462628 Changes needed to Types.java for new datatypes to avoid collisions with Oracle data types
JDK-6462628 : Changes needed to Types.java for new datatypes to avoid collisions with Oracle data types

Details
Type:
Bug
Submit Date:
2006-08-22
Status:
Resolved
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2006-08-23
Component:
core-libs
OS:
generic
Sub-Component:
java.sql
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
cts_5.0
Fixed Versions:

Related Reports
Relates:

Sub Tasks

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

Must be done for GA
                                     
2006-08-22
EVALUATION

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



Hardware and Software, Engineered to Work Together