Required character converter is not available. ERRORCODE=-4220, SQLSTATE=null - java

The application I migrate to Java8 was running on Java7. After the migration i had to update the db2jcc.jar to latest version and yet I have the error below:
Required character converter is not available. ERRORCODE=-4220, SQLSTATE=null
I have checked and tried the topic Getting error code 4220 with null SQL State
My DB version : DB2 v10.5.0.11
The db2 Jar I use : db2jcc-9.5.jar
Has anyone faced this before?
Regards

Your question included
My DB version : DB2 v10.5.0.11
The db2 Jar I use : db2jcc-9.5.jar
The exception text included:
[Camel Thread #2 - JmsConsumer[null]] WARN **** - SQLException: com.ibm.db2.jcc.a.SqlException:
[jcc][t4][10199][10462][3.52.95] Required character converter is not available. ERRORCODE=-4220, SQLSTATE=null
Notice the db2 jdbc driver version, [3.52.95] included in the exception text.
This is an old driver that comes with db2 version 9.5 fixpack2a, long out of support.
You need to be using a recent type 4 jdbc driver for Db2, and the version of the db2 jdbc driver will appear in the exception text as a three part number with a dot separating the parts.
For Db2-LUW v10.5 the currently available version of the db2 type 4 jdbc driver is 4.19.80 although you can use higher versions.
You can download the recent jdbc driver versions from this IBM website, you will need to register with IBM first, although the download is free.

Related

Non supported character set (add orai18n.jar in your classpath)

I am successfully connecting to a Oracle 11g database using objdc8 version 18.3.0.0. When I try to upgrade ojdbc to version 19.3.0.0 I get the following error:
org.hibernate.engine.jdbc.spi.SqlExceptionHelper: Non supported character set (add orai18n.jar in your classpath): WE8PC850
Adding orai18n to the classpath solves the issue, but I don't understand why I need it for ojdbc 19.3.0.0 when it worked perfectly fine without it for ojdbc 18.3.0.0. Has there been some non backwards compatible change that now requires it?
Prior to 19c, the JDBC-thin driver was using a partial implementation of the conversion table for WE8PC850. Starting in 19c it, more correctly, mandates the full conversion table which is included in orai18n.jar. The same thing applies to other character sets that are binary supersets of US7ASCII.

How to use two PostgreSQL DB versions in a single Java Application?

In our Java project we have already connected two DB's to fetch data using two connection pools.
But now one of our DB is upgraded to PostgreSQL 12 and the other DB has the old PostgreSQL 8 version.
We have imported "postgresql-42.2.11.jar" in the project, Can this jar connect both versions or should we import the old "postgresql-8.1-407.jdbc3.jar" too. If so, will we get any error for using two PostgreSQL jars.
But the surprise is, The project works in local system perfectly connecting two versions of DB with one jar ("postgresql-42.2.11.jar"), Just throwing an warning "WARNING [http-nio-8084-exec-55] org.postgresql.jdbc.PgConnection. Unsupported Server Version: 8.1.11",
But after making it live in linux server its not working, it throws an abrupt error as "Exception org.postgresql.util.PSQLException: FATAL: invalid value for parameter "TimeZone": "Asia/Kolkata"".
It looks to me like the 'Kolkata' spelling was not added until June 2008, first appearing in v8.1.12, one minor version newer than you are using.

Setup a Oracle JDBC provider in Websphere 8.0.0.13

We are trying to set up a JNDI (oracle database) on a Websphere Application Server version 8.0.0.13. Running Java 1.6.0:
WebSphere Platform 8.0.0.13 [BASE 8.0.0.13 cf131705.01] running with process name pandora-vmNode01Cell\Aplicacion-node\server1 and process id 5230
Host Operating System is Linux, version 3.13.0-133-generic
Java version = 1.6.0, Java Compiler = j9jit26, Java VM name = IBM J9 VM
I downloaded the ojdbc6.jar from maven and oracle servers and we created a JDBC provider that uses that jar file. And We tried to configure the Datasource with that JDBC provider. But, when we test the connection this error appears:
The test connection operation failed for data source XXXXX_oracle on server
server1 at node Aplicacion-node with the following exception:
java.sql.SQLException: java.lang.UnsupportedClassVersionError: JVMCFRE003 bad
major version; class=oracle/jdbc/pool/OracleConnectionPoolDataSource,
offset=6. View JVM logs for further details.
What can be happening?
We are using the correct ojdbc file because the server is running the same SDK version.
Thank you in advance.
As you've said, the ojdbc6 jar should be compatible with Java 6, so maybe a different version Oracle JDBC driver is actually being used. Is there a different copy of the Oracle JDBC driver present in the app or WebSphere configuration? If so that version, which may require higher than Java 6, could be loaded rather than the ojdbc6 driver you've configured.
Check that there are no additional Oracle JDBC drivers packaged with your application.
Check if there are other Oracle JDBC Providers configured in WebSphere using a newer JDBC driver. If so either modify your configuration so all of your providers are using the same version Oracle JDBC driver or you will need to Isolate your JDBC Providers.
Also, friendly reminder that both WebSphere 8.0 and Java 6 are out of support, so if possible you should migrate to a newer version of both.

Hibernate and MSSQL 2016 issue

I'm facing a problem with a Java application (JVM 1.6) that is using Hibernate 3.6 to access a Microsoft SQL Server via Microsoft JDBC Driver for SQL Server.
When working with SQL JDBC driver 3.0 and MSSQL 2008 - 2014 all is working just fine.
But when I'm trying to use MSSQL 2016, the latest "Microsoft JDBC Driver 6.0" (sqljdbc4.jar) - I get a bunch of those errors:
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
It happens on different entities, and can happen on a get or update operations.
My question: is this an issue with Hibernate that also needs to be updated to a newer version?
I wasn't able to find any information about compatibility issues when accessing MSSQL 2016 via Java/Hibernate.
Thanks!
If possible can you try to use JVM 1.7 and sqljdbc41.jar? Better if you able to use JVM 1.8 and sqljdbc42.jar.
Microsoft recently Open Source their driver on GitHub. You can raise issue on their github project.
As per my understanding for SQL Server 2016 you need either sqljdbc41.jar or sqljdbc42.jar
Further you can found more official documentation on MSDN.
Microsoft JDBC Driver 6.0 and 4.2 for SQL Server:
To support backward compatibility and possible upgrade scenarios, the JDBC Drivers 6.0 and 4.2 include four JAR class libraries in each installation package: sqljdbc.jar, sqljdbc4.jar, sqljdbc41.jar, and sqljdbc42.jar. Note: sqljdbc.jar, sqljdbc4.jar are provided only for backwards compatibility, and do not contain new features included with driver versions 6.0, 4.2, and 4.1.

Errors accessing MSSQL form Xpages using ExtlibX - Driver or JVM not supported

I am trying to connect to SQL from Xpages, so I installed the latest extlibx 9 and downloaded the drivers from microsoft and added it to notes9\data\jvm\lib\ext
Now I get the following errors when trying to query SQL from my xpage:
Error I get in xpages extlibx when using Microsoft SQL Driver sqljdbc.jar
Error while reading the relational data
JRE (Java Runtime Environment) version 1.6 stöds inte av den här drivrutinen. Använd klassbiblioteket sqljdbc4.jar som stöder JDBC 4.0.
In English: JRE (Java Runtime Environment) version 1.6 is not supported by this driver. Use class library sqljdbc4.jar which supports JDBC 4.0.
Error I get in xpages extlibx when using Microsoft SQL Driver sqljdbc4.jar
Error while reading the relational data
Error while creating connection
SQL Server version 8 stöds inte av den här drivrutinen. ClientConnectionId:9195a17a-22f4-4377-a41a-be6f213b05ff
In English: SQL Server version 8 is not supported by this driver
A few years ago there was a file called extlib.driver.mssql_1.0.0.201109061401 which worked just fine using the same SQL server I am using now. but I cannot find that file anymore.
what should I do to get SQL queries working?
Ok, I will answer my own question here
The reason for getting these errors is because I was using the wrong driver.
There are two different version of the drivers so make sure you use the right one
This one do not work
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774
This one works
http://www.microsoft.com/en-us/download/details.aspx?id=2505

Categories