Connection rejected: No connection character set specified (property lc_ctype, encoding, charSet or localEncoding) - firebird

When I try to connect to a Firebird database with dbeaver this error is shown:
Connection rejected: No connection character set specified (property lc_ctype, encoding, charSet or localEncoding). Please specify a connection character set (eg property charSet=utf-8) or consult the Jaybird documentation for more information

Edit Connection -> Driver properties -> Add new property
lc_ctype = .... (example WIN1252,UTF-8,UNICODE,...)
https://www.firebirdsql.org/file/community/ppts/fbcon11/FbCon2011-Charsets-Heymann.pdf

The error says you "Please specify a connection character set" - and that is what you have to do.
Open DBeaver configuration, find the connection string or how it is called in DBeaver, and add any one of the connection encoding parameters with the value you want to the connection URI you set in DBeaver.
See section 3.2 in the Jaybird FAQ:
Jaybird provides two connection properties to specify the connection
character set:
charSet with a Java character set name (alias: localEncoding)
The Java character set name must map to an equivalent Firebird character set.
encoding with a Firebird character set name (alias: encoding[sic, should be lc_ctype])
The Firebird character set name - with the exception of NONE must map to an equivalent Java character set.
For most applications, use only one of these two properties.
For the specifics of this error see section 3.2.3 in the FAQ.

I had to install a past jaybird.jar version 2.2.13 of driver connection of Firebird to fix this problem.

Related

PostgresSQL: org.postgresql.util.PSQLException: ERROR: Unsupported startup parameter: search_path

When I try to connect to the database on postgres via jdbc, I get the following error:
org.postgresql.util.PSQLException: ERROR: Unsupported startup parameter: search_path
This is how I create the connection:
val connection = DriverManager.getConnection(profile.connection + Option(profile.catalog).getOrElse("")+ "?currentSchema="+Option(profile.schema).getOrElse(""),
profile.user, profile.password)
I use scala and a custom version of postgres.
pgbauncer
In short, pgbouncer at least my version does not work with the search_path parameter, this discussion led me to this idea. There are two ways to fix this problem:
Change the pgbouncer config file by adding
IGNORE_STARTUP_PARAMETERS: search_path
Make a connection without using the currentSchema parameter in the connection string and create connection like this:
val connection =
DriverManager.getConnection(
profile.connection + Option(profile.catalog).getOrElse(""),
profile.user, profile.password)
Then he will choose the scheme according to the rule set, in search_path, they usually set something like "$user", public, in this case, when connecting, he first tries to choose the same scheme as the user name, and if he does not find such a scheme, he chooses public.

How to connect a Firebird data base with Knime?

I need connect my Firebird data base (.IDB) in KNIME. I used Database Connector node, but I have this notice:
ERROR Database Connector 0:1 Execute failed: Could not create
connection to database: Invalid connection string
C:\Users\miPC\Desktop\DataBase1.IDB, reason: null or empty database
name in connection string
The error suggest that you have used the following connection string:
jdbc:firebirdsql://C:\Users\miPC\Desktop\DataBase1.IDB
That is incorrect as it is missing the host name. The correct URL would be:
jdbc:firebirdsql://localhost/C:\Users\miPC\Desktop\DataBase1.IDB
Please consult the Jaybird FAQ for valid URL formats.

PostgreSql: 'utf8' codec can't decode byte 0xe9 in position 42: invalid continuation byte

I recently installed PostgreSql and I am trying to create a new database.
Unfortunetly I got and error while creating the database:
"'utf8' codec can't decode byte 0xe9 in position 42: invalid continuation byte"
What is the problem exactly
thank you
Try to add the following line at the end of the pg_hba.conf file and then restart the PostgreSQL service:
host all all all md5
I had a similar error when upgrading from 4.5 to 4.7, the solution was to restart the pgAdmin server.
My error was:
Error: 'utf-8' codec can't decode byte 0xe9 in position 0: invalid continuation byte
It's a conflict between local languages. PgAdmin is in English but maybe in the conf file the lc_messages variable is French, Spanish or something else. Try this
lc_messages = 'en_US'
I tried all the solutions above.
None worked.
The solution for me was to install US ENGLISH as my language on my windows 10.
Then I did the installation all over again in that language.
It's working now, and I do not have use US ENGLISH as my windows language xD

Create db2 dataSource in WAS liberty profile

I am developing for Websphere 8.5 (for z/OS), but i would like to use Liberty for local development on my Windows machine. I can't get the data source to work.
I created the following entry in the Server.xml to define the data source.
<library id="DB2JCC2Lib">
<fileset dir="C:\Program Files\IBM\SQLLIB\java"/><!--includes="db2jcc.jar db2jcc_license_cu.jar db2jcc_license_cisuz.jar"-->
</library>
<dataSource id="xxdb" jndiName="jdbc/xxxx" type="javax.sql.ConnectionPoolDataSource">
<jdbcDriver libraryRef="DB2JCC2Lib" id="db2-driver" javax.sql.ConnectionPoolDataSource="com.ibm.db2.jcc.DB2ConnectionPoolDataSource"/>
<properties.db2.jcc driverType="2" databaseName="xxxx" portNumber="50000" user="xxxx" password="{aes}xxxx"/>
</dataSource>
When my application initializes i get the following error message:
[jcc][4038][12241][3.61.65] T2LUW exception: SQL30081N Kommunikationsfehler. Verwendetes Kommunikationsprotokoll: "TCP/IP". Verwendete Kommunikations-API: "SOCKETS". Position, an der der Fehler erkannt wurde: "127.0.0.1". Übertragungsfunktion, die den Fehler festgestellt hat: "connect". Protokollspezifische(r) Fehlercode(s): "10061", "", "". SQLSTATE=08001
I think this message comes from the db2 Driver, unfortunately i didn't find a way yet to change it to english; but i think it's understandable for english speakers.
I have an ODBC System datasource that connects to DB2 v10 maintenance level 015 for z/OS. My local DB2 Connect Installation is v9.7.300.3885.
In my regular Websphere my working datasource has driver type 2, database Name set to the odbc-name and port number 50000. Server name is not set (empty). Classpath and implementation class is the same that i provided in the server.xml
I have tried everything i could find, any ideas?
Note: I can't make changes on the db2 server and there is no issue connecting to the database with other tools and the regular WebSphere.
Also the server name in the websphere configuration is empty, only database name is set. When i tried to set the servername in the server.xml to localhost or the db2 server i got the same result.
Any help is appreciated!
Edit: updated with correct Version Information
Edit 2: As long as it works i dont care what type (2 or 4) of the jdbc driver is used. I just want to point out again that type 2 is currently working on my machine. I tried it with type 4 and got the following message:
[jcc][t4][2043][11550][3.61.65] Exception java.net.ConnectException: Error opening socket to server xxx/xxx.30.3.34 on port 50,000 with message: Connection refused: connect. ERRORCODE=-4499, SQLSTATE=08001 DSRA0010E: SQL State = 08001, Error Code = -4,499
Sorry, previous post ate my xml. Trying again:
You will need a type 4 datasource to connect to a remote database server, i.e.,
<dataSource id="xxdb" jndiName="jdbc/xxxx" type="javax.sql.XADataSource">
<properties.db2.jcc driverType="4" serverName="the.db2.host.com" portNumber="50000" user="xxxx" password="xxxx" databaseName="LOC1" currentSQLID="SYSA"/>
<jdbcDriver libraryRef="DB2JCC2Lib">
</dataSource>
Type 2 is only for a local z/OS connection to a database resource. Your Windows, being remote from z/OS, requires you to use a type 4 connection. Type 4 requires both the serverName and portNumber to be specified. These are not applicable on a type 2 connection.

How to disable Postgresql messages translation

Is there a way to disable the Postgresql translation of messages? I´m running my appl and Postgresql on a pt_BR Windows machine and when a exception is thrown the error message is translated to Portuguese, like:
Caused by: org.postgresql.util.PSQLException: ERRO: relação "unidade_federacao" não existe
Posição: 25
I would like the messages to appear in English.
I´m using the driver postgresql-8.4-701.jdbc3.jar on a Java (with Hibernate) app.
thanks in advance,
Fabrício Lemos
You could change lc_messages in postgresql.conf or just per database:
ALTER DATABASE dbname SET lc_messages=en_us;
See also the manual.
Under Windows, some psql error messages are getting translated corresponding to the format setting in Windows settings -> Clock, Language, and Region -> Change location -> Formats -> Format.
To prevent a mix of translated and untranslated messages, I've set this format to "English (United States)".
execute the following query to your database in order to find the postgres.conf file which is loaded for the configuration:
SHOW config_file;
Edit your postgres.conf file with your prefered lc.... lc_messages,lc_numeric...etc.
i think you can change all with lc_ALL
example : lc_ALL=en_US.UTF-8
Finally execute the following command to reload conf.
SELECT pg_reload_conf();