Java oracle 12c 的休眠方言

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31698651/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 11:27:27  来源:igfitidea点击:

hibernate dialect for oracle 12c

javaoraclehibernate

提问by hamed

I'm using hibernate in my spring mvc project and I want to connect to oracle 12c database. I used org.hibernate.dialect.Oracle12cDialect, but, this returns me org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.dialect.Oracle12cDialect] as strategy [org.hibernate.dialect.Dialect]. How can I set dialect for oracle 12c? I'm using hibernate 4.3.9.

我在 spring mvc 项目中使用 hibernate,我想连接到 oracle 12c 数据库。我使用了org.hibernate.dialect.Oracle12cDialect,但是,这返回了我org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.dialect.Oracle12cDialect] as strategy [org.hibernate.dialect.Dialect]。如何为 oracle 12c 设置方言?我正在使用休眠4.3.9

回答by wjans

Try to use org.hibernate.dialect.Oracle10gDialect, seems to be the highest possible version in Hibernate 4.3.9.

尝试使用org.hibernate.dialect.Oracle10gDialect,似乎是Hibernate中的最高版本4.3.9

A dialect for 12c seems to be present in later versions, see this.

12c 的方言似乎出现在更高版本中,请参阅

回答by Darshna

org.hibernate.dialect.Oracle12cDialectcan be used with hibernate-core version 5.0

org.hibernate.dialect.Oracle12cDialect可以与 hibernate-core 5.0 版一起使用

See: https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/dialect/Oracle12cDialect.html

请参阅:https: //docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/dialect/Oracle12cDialect.html

回答by Vladyslav Beziazychenko

(Maven) for:

(Maven) 用于:

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.4.9.Final</version>
    </dependency>

You might want to add this dialect:

您可能想要添加此方言:

<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>