问题
This post is similar to link
But I do not find answer. I am migrating from Oracle 11g to Oracle 12c. Can I use the same dialect available with hibernate 3.3.0 org.hibernate.dialect.OracleDialect
.
Also I am using ojdbc14.jar which is JDBC driver version 10.2.0.3.0. And as per Oracle I need to use atleast ojdbc6.jar or minimum JDBC driver version 11.1.0.x. If I use ojdbc6.jar then I need to resolve conflicts of java.sql.date
and Timestamp
SQL type; change Long types to LOB types. Please correct if I am wrong and let me know other things as well which I may be missing.
回答1:
see this link Differences between classes12.jar, ojdbc14.jar, ojdbc5.jar and ojdbc6.jar. The name of the driver file has noting to do with the datbase driver version. It just matches compliance with the version of JDBC standard.
So ojdbc6.jar can have driver version 10g, 11g or 12c. It can even be a driver provided by Oracle support containing one specific fix just for you.
Since some version (1.5) Oracle JDBC drivers are executable. You can simply execute them to get exact version:
java -jar ojdbc5.jar
Oracle 11.2.0.3.0 JDBC 3.0 compiled with JDK5 on Tue_Aug_23_13:32:03_PDT_2011
#Default Connection Properties Resource
#Wed Apr 06 12:37:06 CEST 2016
You should not use ojdbc14.jar, unless you're still on Java 1.4.
Oracle guarantees compatibility with clients having difference of one in major version number. In some cases this can by bypassed by setting SQLNET.ALLOWED_LOGON_VERSION in sqlnet.ora file on db server side.
回答2:
Refer to the FAQ for more details on JDBC driver versions. Best Practice recommended is, JDBC driver version should always be either same as or higher than the Oracle database version being used in order to leverage the latest capabilities of the driver.
来源:https://stackoverflow.com/questions/36447255/hibernate-3-3-0-compatibility-with-oracle-12c