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

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]
I've tried to give a path in the file encoding, but I don't have any idea to how Jaybird works.
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. 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

Related

DBT: How to fix Database Error Expecting Value?

I was running into troubles today while running Airflow and airflow-dbt-python. I tried to debug a bit using the logs and the error shown in the logs was this one:
[2022-12-27, 13:53:53 CET] {functions.py:226} ERROR - [0m12:53:53.642186 [error] [MainThread]: Encountered an error:
Database Error
Expecting value: line 2 column 5 (char 5)
Quite a weird one.
Possibly check your credentials file that allows DBT to run queries on your DB (in our case we run DBT with BigQuery), in our case the credentials file was empty. We even tried to run DBT directly in the worker instead of running it through airflow, giving as a result exactly the same error. Unfortunately this error is not really explicit.

Robot Framework - Database library how to connect using Windows Authentication

I am trying to connect to SQL server database using windows authentication, i Have tried the following:
*** Settings ***
Suite Setup Connect To Database Using Custom Params pyodbc ${DBHost_ConnectionString}
Suite Teardown Disconnect From Database
Connection string :
${DBHost_ConnectionString}= Server=ServerName;Database=DbName;Trusted_Connection=yes;
Which produces
pyodbc.connect(db_api_2.connect(Server=ServerName;Database=DbName;Trusted_Connection=yes;))
This is the Error:
SyntaxError: invalid syntax (<string>, line 1)
Don't use semicolon (;) as delimiters, use commas (,):
${DBHost_ConnectionString}= Set Variable Server='ServerName', Database='DbName', Trusted_Connection='yes'
Also don't forget to put the arguments values in quotes.
The reason is the string you provide turns up as-is in the connect() method - so they must follow the proper python syntax for method's arguments.

Special character (!, exclamation mark) in DB2 user password gives error when starting i2 Analyze or connecting from DB2 command console

The following error occurs when starting i2 Analyze with example deployment
(some parts of error messages are in Finnish because of the Windows localization settings, sorry about that)
setup -t startLiberty
java.sql.SQLInvalidAuthorizationSpecException: [jcc][t4][2013][11249][4.17.29] On ilmennyt yhteyden käyttöoikeusvirhe. Syy: Käyttäjätunnus tai tunnussana ei kelpaa. ERRORCODE=-4214, SQLSTATE=28000 DSRA0010E: SQL State = 28000, Error Code = -4 214
I believe the error is more closely related to DB2(10.5 FP7) & Windows(W12R2) than i2 Analyze itself because when connecting from DB2 command console (db2cmd) and giving both username and password (with !) within a single line:
connect to WRITESTORE user db2admin using <SomePasswordWith!>
The error shown in console is as follows:
SQL0104N Järjestelmä on löytänyt merkkijonoa "<tunnus>" seuraavan
tunnistamattoman sanakkeen "!". Odotettuja sanakkeita ovat esimerkiksi
seuraavat: "NEW". SQLSTATE=42601
Anyhow, if password (with character !) is given only when prompted eg:
connect to WRITESTORE user db2admin
and giving password when asked, user is logged in without an error.
Also when connecting to DB2 with IBM DataStudio gives no error.
So, using passwords without special characters is a workaround for the issue.
http://www-01.ibm.com/support/docview.wss?uid=swg21303153
Username/password with special characters need to be quoted when using them through CLP within db2prompt
Lainausmerkkeihin :)
connect to WRITESTORE user db2admin using '<SomePasswordWith!>'

How do I fix "datasource serviceImpl.error_0009" in pentaho?

I log into pentaho using the administrator's username and password, then go into file > new > datasource select "SQL QUERY", then type in my database and test it for database connection, it is successful. When I try to test the new datasource with the sql query, I type in "select 1 from mytable" and it gives me this error:
datasourceServiceImpl.error_0009
query validation failed: query validation failed {0}
This is all that it is giving me and I don't know how to fix this.
I have biserver-ce-5.1.0.0-752 running
I fixed the issue by removing ";" at the end of my query.
Stop the server.
Change the mysql driver folder .. \ tomcat \ lib "mysql-connector-java-5.1.17.jar" the driver "mysql-connector-java-5.1.25-bin.jar".
Restart the server and it will work.
I got this error and found that it was as simple as having 2 columns named the same thing in my SELECT statement.
Install mysql-connector-java-gpl-x.x.x.msi
Put into lib folder mysql-connector-java-x.x.x.jar

H2 - Split file option in server mode

Using H2 database, is it possible to use the split file option while in (SSL) server mode and using encryption? If so, how can I do it?
I created a split database using this JDBC string:
jdbc:h2:split:28:/g:/db_split;CIPHER=AES
It is stated that a split database always needs the :split option afterwards, which seems true because I get errors about corrupted files when connecting with
jdbc:h2:ssl://g:/db_split;CIPHER=AES
General error: "java.lang.NumberFormatException: Zero length string" [50000-170] HY000/50000
But when I attach the appropriate option, another error follows:
jdbc:h2:split:ssl://g:/db_split;CIPHER=AES
IO Exception: "java.io.IOException: A sintaxe do nome do arquivo, do nome do diretório ou do rótulo do volume está incorreta"; "ssl://g:/db_split.h2.db" [90031-170] 90031/90031 (Error message localized in Portuguese - something like "The syntax for file name, folder name or volume label is incorrect")
Is there a way to make these options coexist? I am considering AUTO_SERVER, but it would be a lousy option.
For the server mode, use:
jdbc:h2:tcp://localhost/split:28:/g:/db_split;CIPHER=AES
When using SSL:
jdbc:h2:ssl://localhost/split:28:/g:/db_split;CIPHER=AES
For embedded mode, use:
jdbc:h2:split:28:/g:/db_split;CIPHER=AES