如何在导入Quarkus Hibernate ORM后配置Quarkus与Oracle数据库?

huangapple go评论72阅读模式
英文:

How to configure Quarkus with Oracle Database after importing quarkus-hibernate-orm?

问题

驱动程序名称在Quarkus应用程序中应该如何指定?

quarkus.datasource.ergoint.driver=org.xxx.xxx.Driver

如果它不提供原生支持,那么我们如何通过在Maven项目中添加依赖项来修复这个问题?

注意: 官方网站上没有提到与Oracle相关的内容 -> https://quarkus.io/guides/datasource#multiple-datasources

英文:

What is driver name to be given in quarkus application?

quarkus.datasource.ergoint.driver=org.xxx.xxx.Driver

If it does not provide native support then how can we fix this adding dependency in maven project?

Note: On official website nothing mentioned related to Oracle -> https://quarkus.io/guides/datasource#multiple-datasources

答案1

得分: 2

暂时,在 Quarkus 中没有 Oracle 特定的扩展,但有一个相关的开放问题,您可以在此链接上支持它:https://github.com/quarkusio/quarkus/issues/1658

如果您需要使用 Oracle 数据库,您可以按照与其他框架相同的方式进行操作:将依赖项添加到您的 pom.xml 文件中(现在 Oracle 已经在 Maven 中央库中提供了它们),并在 application.properties 中进行配置。

在您的情况下,应该是这样的:

quarkus.datasource.ergoint.driver=oracle.jdbc.driver.OracleDriver

如果您需要将应用程序部署为本机映像,您需要进行一些工作以使 Oracle 驱动程序正常工作,您可以在此处找到一些信息:https://github.com/oracle/graal/issues/1748

英文:

For the moment, there is no Oracle specific extension inside Quarkus, but there is an open issue for it you can +1 on it : https://github.com/quarkusio/quarkus/issues/1658

If you need to use Oracle database, you can do it the same way you did for othe framework: add the dependency inside your pom.xml (easy now that Oracle provides them in Maven central) and configure it inside the application.properties

In your case it should be

quarkus.datasource.ergoint.driver=oracle.jdbc.driver.OracleDriver

If you need to deploy your application as a native image, you will need some work to make the Oracle driver works, you can find some information here: https://github.com/oracle/graal/issues/1748

答案2

得分: 0

以下是翻译好的部分:

    quarkus.datasource.db-kind=other
    quarkus.hibernate-orm.dialect=org.hibernate.dialect.OracleDialect
    quarkus.datasource.jdbc.driver=oracle.jdbc.driver.OracleDriver
    quarkus.datasource.jdbc.url=jdbc:oracle:thin:@XXX.XXX.XXX.XXX:1521:XXXXX
    quarkus.datasource.username=USERNAME
    quarkus.datasource.password=PASSWORD
英文:

Here started to work with the following:


    quarkus.datasource.db-kind=other
    quarkus.hibernate-orm.dialect=org.hibernate.dialect.OracleDialect
    quarkus.datasource.jdbc.driver=oracle.jdbc.driver.OracleDriver
    quarkus.datasource.jdbc.url=jdbc:oracle:thin:@XXX.XXX.XXX.XXX:1521:XXXXX
    quarkus.datasource.username=USERNAME
    quarkus.datasource.password=PASSWORD

答案3

得分: 0

在1.13.2.Final版本中,已添加了对Oracle的支持。

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-jdbc-oracle</artifactId>
</dependency>

quarkus.datasource.db-kind=oracle
英文:

In release 1.13.2.Final the support for oracle has been added.

&lt;dependency&gt;
    &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
    &lt;artifactId&gt;quarkus-jdbc-oracle&lt;/artifactId&gt;
&lt;/dependency&gt;

quarkus.datasource.db-kind=oracle

huangapple
  • 本文由 发表于 2020年1月3日 17:22:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/59575919.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定