Springboot: pom.xml org.firebirdsql.jdbc jaybird 4.0.0.java8
application.properties
spring.datasource.url=jdbc:firebirdsql://SERVER:3050/D:\company\DbPro\Data\file.fdb
spring.datasource.driverClassName=org.firebirdsql.jdbc.FBDriver
I get an error when querying the database:
Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: I/O error during "CreateFile (open)" operation for file "D:companyDbProDatafile.fdb"; Error while trying to open file; [SQLState:08001, ISC error code:335544344]
What's wrong?
As shown in the error message, Firebird tries to connect to a database
D:companyDbProDatafile.fdb, which doesn't exist (or is otherwise inaccessible).The reason your path is incorrect, is that
\denotes an escape in a properties file. As documented onProperties.load:To fix this, make sure to double back-slashes, or use the forward slash instead. So use:
or
Alternatively, instead of specifying a path to your database, configure an alias in
databases.conf(Firebird 3 and higher) oraliases.conf(Firebird 2.5 and lower) and specify the alias in your connection string instead of the path.