Moony
Moony

Reputation: 11

"Unexpected end of command - line 1, column 8" in JetBrains DataGrip trying to connect to Firebird

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?

Upvotes: 1

Views: 801

Answers (1)

Mark Rotteveel
Mark Rotteveel

Reputation: 108962

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

Upvotes: 4

Related Questions