Hibernate3 with Oracle 12c

*爱你&永不变心* 提交于 2019-12-23 10:57:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!