Home > Software design >  IntelliJ data source connection with Firebird database
IntelliJ data source connection with Firebird database

Time:06-18

I am unable to make DataSource connection with "Firebird" using IntelliJ IDEA (Java 11). I have successfully connected with Firebird example db using ISQL Tool (Command Line Interface) Success Connection

Even after going through multiple blogs, it's not working, I still need guidance. Please advise.

Data Source IntelliJ

I get following error:

Error

CodePudding user response:

Database is accessible using IntelliJ IDEA, and I am able to access tables using SQL. Test connection was never successful, but it still connects and works fine. I ignored the test connection and resolved it by using following data source connection string:

jdbc:firebirdsql://localhost:3050/C:/ProgramFiles/Firebird/Firebird_3_0/examples/empbuild/employee.fdb

CodePudding user response:

The problem is caused by IntelliJ executing a "keep-alive query" when testing the connection, but the default configuration for the Firebird driver doesn't have a keep-alive query. It seems that IntelliJ executes this query unconditionally, even if it is an empty string. This causes Firebird to return an error, because an empty string is not a valid statement.

To solve this, go to the "Drivers" tab of the "Data Sources and Drivers" screen, select "Firebird" (under "Basic Support"), and on the options tab, enter the "Keep-alive query" select 1 from rdb$database.

As an aside, you can make the warning about the connection character set go away by explicitly configuring a connection character set (property charSet) on the "Advanced" tab.

  • Related