I have upgraded our Oracle Type 4 - pure Java driver from older version to ojdbc8.jar. This is needed for Oracle 12c R2 compatibility as well as JDK 8 compatibility.
However, the code which was working with earlier driver now starts failing while reading NVARCHAR columns through plain SQL queries. Here are the details:
I am using session.createSQLQuery(…) to execute plain SQL query
I am applying setResultTransformer(new AliasToBeanResultTransformerExt(SomeEntity.class)); on top of SQLQuery
This query execution fails for SQL which reads NVARCHAR columns with wxception
setResultTransformer(new AliasToBeanResultTransformerExt(AssignableSync.class)); org.hibernate.MappingException: No Dialect mapping for JDBC type: -9
How to resolve this error?
I am using org.hibernate.dialect.Oracle10gDialect for Oracle 12.2 database and using Hibernate version of 3.5.1
Just wondering and curious how it was working with ojdbc7 and even with ojdbc5 jars.
You can debug it to see how it was working. However, it does not really matter because Hibernate 3.5 was not meant to support JDBC 4.2, hence you need to upgrade anyway.