【问题标题】:Spring Boot JPA with not a well known database没有知名数据库的 Spring Boot JPA
【发布时间】:2017-11-06 13:33:14
【问题描述】:

我正在尝试编写 Spring Boot 应用程序以连接到 Teiid 数据库,我想在其上使用 JPA 层。我已经配置了 JDBC 数据源,但是由于 Spring JPA 库中这个不知名的数据库不会自动检测这个源。我也手动设置了“spring.jpa.*”属性。我确实有这个数据库的 Hibernate 方言,它在类路径上。

那么,在 Spring Boot 中,一个不知名的数据库需要如何配置 JPA 层呢?感谢您的宝贵时间。

拉梅什..

【问题讨论】:

    标签: spring hibernate jpa spring-boot teiid


    【解决方案1】:

    这在Spring Boot documentation 中有很好的定义。

    您可以在application.properties 文件中明确设置

    spring.datasource.url=jdbc:mysql://localhost/test
    spring.datasource.username=dbuser
    spring.datasource.password=dbpass
    spring.datasource.driver-class-name=com.mysql.jdbc.Driver
    

    【讨论】:

      猜你喜欢
      • 2016-08-08
      • 2017-02-20
      • 2017-09-09
      • 2014-10-21
      • 2017-08-22
      • 2014-07-21
      • 2021-05-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多