JPA connection to Firebird error

Asked

Viewed 197 times

0

I always used mysql for the database, but now I have a need to connect with a band Firebird(FDB) in a project, I am using Maven, when trying to connect spring returns me the following error:

Caused by: java.lang.IllegalStateException: Cannot load driver class: org.firebirdsql.jdbc.FBDriver

In my Pom.xml I put this dependency:

    <dependency>
        <groupId>org.firebirdsql.jdbc</groupId>
        <artifactId>jaybird-jdk18</artifactId>
        <version>3.0.8</version>
        <scope>test</scope>
    </dependency>

And my application.properties is configured that way:

 spring.datasource.url=jdbc:firebirdsql://localhost:3050/D:\\banco\\taciana\\DBLOCAL.FDB
spring.datasource.driver-class-name=org.firebirdsql.jdbc.FBDriver
spring.jpa.database-platform=org.hibernate.dialect.FirebirdDialect
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

Thanks in advance for the help!

  • Dude if anyone helps you I’ll thank you very much too, once I tried even gave up and made an integration in php Rest

  • 1

    I already researched a lot and I didn’t find the solution, all examples of connections I found uses this driver class name "org.firebirdsql.jdbc.Fbdriver", but they are old examples, may be updated as mysql

  • I took it as a Firebird problem and gave up, I spoke in php but actually I did a Delphi, the system had to work only in a local environment.

  • 1

    @Gabriellocalhost guy got here, my problem was that the tag Scope on dependency, it was set as test, and the "Right" would put Runtime

1 answer

0

Solved, it worked after modifying the dependency tag Scope

<dependency>
    <groupId>org.firebirdsql.jdbc</groupId>
    <artifactId>jaybird-jdk18</artifactId>
    <version>3.0.8</version>
    <scope>test</scope>
</dependency>

modify tag test Scope for Runtime

Browser other questions tagged

You are not signed in. Login or sign up in order to post.