<author email="javajedi@users.sf.net">Tim McCune</author>
</properties>
<body>
+ <release version="2.0.8" date="TBD">
+ <action dev="jahlborn" type="fix" system="SourceForge2" issue="113">
+ Add newer sql type to access type mappings if the jvm supports them.
+ </action>
+ </release>
<release version="2.0.7" date="2014-11-22">
<action dev="jahlborn" type="fix" system="SourceForge2" issue="111">
Unicode compression support was not correct for all possibly
ALT_SQL_TYPES.put(Types.VARCHAR, MEMO);
ALT_SQL_TYPES.put(Types.VARBINARY, OLE);
ALT_SQL_TYPES.put(Types.BINARY, OLE);
+
+ // add newer sql types if available in this jvm
+ addNewSqlType("NCHAR", TEXT, null);
+ addNewSqlType("NVARCHAR", TEXT, MEMO);
+ addNewSqlType("LONGNVARCHAR", MEMO, null);
+ addNewSqlType("NCLOB", MEMO, null);
+ addNewSqlType("TIME_WITH_TIMEZONE", SHORT_DATE_TIME, null);
+ addNewSqlType("TIMESTAMP_WITH_TIMEZONE", SHORT_DATE_TIME, null);
}
private static Map<Byte, DataType> DATA_TYPES = new HashMap<Byte, DataType>();
return rtn;
}
+ /**
+ * Adds mappings for a sql type which was added after jdk 1.5 (using
+ * reflection).
+ */
+ private static void addNewSqlType(String typeName, DataType type,
+ DataType altType)
+ {
+ try {
+ java.lang.reflect.Field sqlTypeField = Types.class.getField(typeName);
+ Integer value = (Integer)sqlTypeField.get(null);
+ SQL_TYPES.put(value, type);
+ if(altType != null) {
+ ALT_SQL_TYPES.put(value, altType);
+ }
+ } catch(Exception ignored) {
+ // must not be available
+ }
+ }
+
}