dynamobi/dynamobi — Issue #363: [FRG-406] SqlTypeName assumptions about min/max JDBC type are invalid under JDK 1.6
Author: dynamobi-build
Created: 2011-12-30 03:10:48+00:00
State: open
Labels: FRG

[reporter="emcdermid", created="Tue, 10 Aug 2010 21:58:36 -0500 (GMT-05:00)"]
SqlTypeName.java sets MIN_JDBC_TYPE and MAX_JDBC_TYPE to values that are valid for JDK 1.5. Unfortunately, JDK 1.6 introduced type constant values outside of this range.

If one of these new constants is returned by a call to a JDBC4 driver, SqlTypeName.getNameForJdbcType(int) will fail with an ArrayIndexOutOfBoundsException.

A typical case of this could be the Microsoft JDBC 4.0 driver. Earlier versions of the driver reported the type of NVARCHAR columns in SqlServer as VARCHAR, which would work. With the newer driver, however, NVARCHAR will be returned.