1

I'm trying to connect to a Firebird database hosted in a Docker from the DataGrip client, but this error appears:

WARNING: No connection character set specified (property lc_ctype, encoding, charSet or localEncoding
[42000][335544851] Dynamic SQL Error; SQL error code = -104; Unexpected end of command - line 1, column 8 [SQLState:42000, ISC error code:335544851]

WARNING: No connection character set specified (property lc_ctype, encoding, charSet or localEncoding), defaulting to character set NONE

I've tried to give a path in the file encoding, but I don't have any idea to how Jaybird works.

enter image description here

What do I need to do?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Moony
  • 11
  • 2
  • The problem is not that warning, because it is just a warning. The problem is the error below that warning, which is caused by the fact that IntelliJ/DataGrip wants to execute a keep-alive/test-query, but it doesn't have a default query configured for Firebird. – Mark Rotteveel Nov 26 '22 at 08:27

1 Answers1

3

The problem is caused by IntelliJ (DataGrip is based on 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. When no keep-alive query is configured, IntelliJ seems to execute the query select 1 (though I haven't verified this, the fact the error mentions "column 8" seems to hint at that). This causes Firebird to return an error, because Firebird requires a from-clause.

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 of the connection configuration.

I reported this to JetBrains: Configuration for Firebird misses default keep-alive query causing error on connection test

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197