Hibernate无法确定方言(Hibernate cannot determine dialect)

编程入门 行业动态 更新时间:2024-10-25 18:31:59
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.

更多推荐

本文发布于:2023-04-29 04:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1335256.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方言   Hibernate   dialect   determine

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!