问题
We are upgrading oracle from 11g to 12c. My application is using hibernate3.jar
which is 3.6.8-Final version. It works great with 11g using Oracle10gDialect
but when I connect to 12c database I get below error. I also changed classes12.jar to ojdbc7.jar.
Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to determine Dialect to use [name=Oracle, majorVersion=12]; user must register resolver or explicitly set 'hibernate.dialect'
I tried downgrading till 3.1.1
and upgrading till 3.6.10-Final
. Below 3.6.8
my code wont compile as there is no Oracle10gDialect class before that. And even 3.6.10-final
version gives me same above error. I cannot upgrade to Hibernate 4. Any advise will be of great help. thank you.
回答1:
If I recall correctly, you need to explicitly declare what dialect to use. I think we did a JVM option -Dhibernate.dialect=org.hibernate.dialect.Oracle10gDialect
or we added a configuration in domain.xml
(if you're using Glassfish) hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
. Hope this helps.
来源:https://stackoverflow.com/questions/35948934/hibernate3-with-oracle-12c