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
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