春天+火鸟

Paw*_*ler 1 firebird spring jaybird

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

谢谢

Mon*_*mul 9

如果您使用带有 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
Run Code Online (Sandbox Code Playgroud)

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

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

<dependency>
    <groupId>org.firebirdsql.jdbc</groupId>
    <artifactId>jaybird-jdk18</artifactId>
    <version>2.2.12</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)