Hibernate无法确定方言(Hibernate cannot determine dialect)
我正在使用hibernate 4.3.x连接到oracle数据库。
但是在创建映射文件时它会抛出
“无法确定要使用的方言[name = Oracle,majorVersion = 12] ......”
这应该是hiberante 3.x中的问题(根据谷歌)
我怎样才能解决这个问题? 谢谢
//编辑
配置属性:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property> <property name="hibernate.connection.url">jdbc:oracle:...</property> <property name="hibernate.connection.username">name</property> <property name="hibernate.connection.password">Passwd</property> <mapping class="Nemocnica" package="Model"/> </session-factory> </hibernate-configuration>I am using hibernate 4.3.x to connect to oracle database.
However while creating mapping file it throws
"Unable to determine Dialect to use [ name = Oracle , majorVersion = 12 ]..."
which should be problem ( according to google ) in hiberante 3.x
How can i fix this? Thanks
//edit
Config properties:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property> <property name="hibernate.connection.url">jdbc:oracle:...</property> <property name="hibernate.connection.username">name</property> <property name="hibernate.connection.password">Passwd</property> <mapping class="Nemocnica" package="Model"/> </session-factory> </hibernate-configuration>最满意答案
似乎hibernate检测Oracle 12方言存在问题。
使用:
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>Oracle 10方言也应该与Oracle 12一起使用。
It seems that there is an issue with hibernate detecting Oracle 12 dialect.
Use:
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>Oracle 10 dialect should work with Oracle 12 also.
更多推荐
发布评论