[英]"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:我正在尝试从 DataGrip 客户端连接到 Docker 中托管的 Firebird 数据库,但出现此错误:
WARNING: No connection character set specified (property lc_ctype, encoding, charSet or localEncoding警告:未指定连接字符集(属性 lc_ctype、编码、charSet 或 localEncoding
[42000][335544851] Dynamic SQL Error; [42000][335544851] 动态 SQL 错误; SQL error code = -104; SQL 错误代码 = -104; Unexpected end of command - line 1, column 8 [SQLState:42000, ISC error code:335544851]命令行意外结束 - 第 1 行,第 8 列 [SQLState:42000,ISC 错误代码:335544851]
I've tried to give a path in the file encoding, but I don't have any idea to how Jaybird works.我试图在文件编码中提供路径,但我对 Jaybird 的工作原理一无所知。
What do I need to do?我需要做什么?
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.问题是由于 IntelliJ(DataGrip 基于 IntelliJ)在测试连接时执行了“keep-alive query”,但 Firebird 驱动程序的默认配置没有 keep-alive 查询。 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).当没有配置 keep-alive 查询时,IntelliJ 似乎执行查询select 1
(虽然我没有验证这一点,但错误提到“第 8 列”的事实似乎暗示了这一点)。 This causes Firebird to return an error, because Firebird requires a from-clause.这会导致 Firebird 返回一个错误,因为 Firebird 需要一个 from 子句。
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
.要解决此问题,go 到“数据源和驱动程序”屏幕的“驱动程序”选项卡,select“Firebird”(在“基本支持”下),然后在选项选项卡上,输入“保持活动查询” 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.另外,您可以通过在连接配置的“高级”选项卡上显式配置连接字符集(属性charSet
)来消除有关连接字符集 go 的警告。
I reported this to JetBrains: Configuration for Firebird misses default keep-alive query causing error on connection test我向 JetBrains 报告了这个: Firebird 的配置错过了默认的保持活动查询,导致连接测试出错
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.