【问题标题】:Spring + firebird春天+火鸟
【发布时间】:2017-02-14 07:56:46
【问题描述】:

有人成功将 spring 连接到 .gdb 数据库或 .fdb 数据库吗? 我需要一点帮助来执行一些查询并将其显示在屏幕上。 网上几乎没有关于spring连接firebird的资料...

谢谢

【问题讨论】:

标签: spring firebird jaybird


【解决方案1】:

如果您使用带有 maven 的 Spring Boot,请使用以下内容更新您的 application.properties

spring.datasource.url:jdbc:firebirdsql://localhost:3050/C:\\firebird\\firebird.GDB
spring.datasource.driverClassName:org.firebirdsql.jdbc.FBDriver
spring.datasource.username:SYSDBA
spring.datasource.password:masterkey
spring.jpa.hibernate.ddl-auto:update
spring.jpa.show-sql: true
spring.jpa.properties.hibernate.format_sql=true

并记得相应地设置您的 gdb 位置、用户名、密码。

并在 pom.xml 中添加以下依赖

<dependency>
    <groupId>org.firebirdsql.jdbc</groupId>
    <artifactId>jaybird-jdk18</artifactId>
    <version>2.2.12</version>
</dependency>

【讨论】:

  • 在 Windows 上工作得很好,但在 Mac 上 javax 有问题......无论如何,谢谢!你有一些示例实现吗?
  • @PawełMeller 您能否更具体地了解 “javax 存在问题...”
【解决方案2】:

我使用 java8、gradle 6.6.1、SpringBoot 2.2.6 和 jaybird-jdk16:2.2.13

在应用程序属性中: spring.jpa.database-platform=org.hibernate.dialect.FirebirdDialect spring.datasource.driverClassName = org.firebirdsql.jdbc.FBDriver spring.datasource.url=jdbc:firebirdsql:XXX.XXX.X.XXX:/databases/firebird/name_file.fdb spring.datasource.password = XXXX spring.datasource.username = XXXX

spring.jpa.hibernate.ddl-auto=none spring.jpa.open-in-view=false

【讨论】:

    猜你喜欢
    • 2010-11-22
    • 1970-01-01
    • 2014-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-23
    • 2012-02-06
    • 2011-10-23
    相关资源
    最近更新 更多