I am trying to connect to a firebird db using the jaybird jdbc driver. Firebird is running under ubuntu. I have created a simple database located under /tmp/hellofb.fdb (yeah not the best place, just for testing). I am running firebird superserver 3.0. The firebird service is up and running sudo service firbird3.0 status
:
firebird3.0.service - Firebird Database Server ( SuperServer )
Loaded: loaded (/lib/systemd/system/firebird3.0.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2017-10-25 22:40:53 CEST; 25min ago
Process: 23411 ExecStart=/usr/sbin/fbguard -pidfile /run/firebird3.0/default.pid -daemon -forever (code=exited, status=0/SUCC
Main PID: 23412 (fbguard)
Tasks: 4 (limit: 4915)
CGroup: /system.slice/firebird3.0.service
├─23412 /usr/sbin/fbguard -pidfile /run/firebird3.0/default.pid -daemon -forever
└─23413 /usr/sbin/firebird
Okt 25 22:40:53 XPS-L322X systemd[1]: Starting Firebird Database Server ( SuperServer )...
Okt 25 22:40:53 XPS-L322X systemd[1]: Started Firebird Database Server ( SuperServer ).
My spring boot application.properties is given by:
spring.datasource.url:jdbc:firebirdsql://localhost:3050//tmp/hellofb.fdb
spring.datasource.driverClassName:org.firebirdsql.jdbc.FBDriver
However, when I try to connect to the database, I get the following exception:
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544421. connection rejected by remote interface
I have tried all possible permutations given by the jaybird FAQ, I am running out of options. Any help would be greatly appreciated!
Note: I tried to connect to the databse using flamerobin and everything works just fine
Given you haven't provided the information I asked for in the comments, I have to guess you are using Firebird 3 with Jaybird 2.2.x based on the described behavior.
The error connection rejected by remote interface can also occur under other conditions than described below.
Possible cause: wire protocol encryption required
Firebird 3 introduces a number of new security features that are enabled by default, but are not supported by Jaybird 2.2. To allow Jaybird 2.2 to connect to Firebird 3 you need to relax some of those settings.
To allow Jaybird 2.2.x to connect, you need to change the following settings in
firebird.conf
(and restart Firebird after changing the setting):Relax the
WireCrypt
setting from its default ofRequired
toEnabled
:Enable support for the legacy authentication protocol:
You then need to make sure the user you want to use for connecting to Firebird is created with the legacy usermanager by enabling support for the legacy usermanager:
Restart Firebird to apply these settings, and then - in Flamerobin - with a SYSDBA account (or user with role RDB$ADMIN), create the required user:
Alternatively you could upgrade to Jaybird 3.0.4 or higher, which supports the
Srp
authentication protocol and wire protocol encryption.These settings are described in more detail on our wiki in article Jaybird and Firebird 3. This information was absent from our FAQ, I have now added it under connection rejected by remote interface (335544421).
Possible cause: no user name or password
With Jaybird 3 or higher and Firebird 3 or higher, this error can be the result of not providing a username or password. The absence of a user name or password causes Jaybird to not try any authentication plugin. This results in Firebird rejecting the connection attempt as at least one authentication attempt should be done.