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

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.

Related

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.

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

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.

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.

Oracle jdbc driver 11, wrong symbols after migration

We are in process of migration from jdk 1.5 and oracle driver 10.2.0.2 to jdk 1.7 and driver 11.1.0.7 Database is oracle 11g. NLS_CHARACTERSET = WE8ISO8859P1.
We faced issue with em-dash, unicode 150 character (http://www.codetable.net/decimal/150). It is stored in database like 150, I have checked with select dump(name) from client
When try to read and write to file this string, it substitutes em-dash with ? (question mark).With old driver and environment with 1.5. Everything was ok, it was in file like em-dash.
I found that locale were changed in new servers, previously it was en_GB now it is C. So tried to run my java application with following parameters -Duser.country=GB -Duser.language=en.
But it doesn't help, what more can I do?

Java Stored Procedure using MQ

I need to create a Java stored procedure in Oracle. I have used IBM's sample class for creating an MQ message from a simple class outside of Java EE environment. I have tested the class by itself and it is working.
My Oracle vesrion is 11i.
When I am trying to add the jars used in the simple application to load to Oralce along with my simple class, I am getting errors about class not found, even if same jars work with the test case. I am stuck with this for over a week and am desperately hoping that someone would be able to help me with it.
Kinds of errors I am getting are like this from -v flag with loadjava utility on the client
on line 326 / 327, you see this:
creating : class com/ibm/mq/jms/admin/AP loading : class
com/ibm/mq/jms/admin/AP
and then at the end starting from line 6224 to end, it indicates that the above class can’t be resolved:
com/ibm/mq/jms/admin/APRCXI: ORA-29534: referenced object
xxxx.com/ibm/mq/jms/admin/AP could not be resolved
com/ibm/mq/jms/admin/APSDX: ORA-29534: referenced object xxxx.com/ibm/mq/jms/admin/AP could not be resolved exiting : errors
resolving class com/ibm/mq/jms/admin/AP
the command I used is:
c:\Oracle\product\11.2.0\client_1\bin\loadjava.bat -f -jarsasdbobjects
-prependjarnames -stoponerror -u xxxx/yyyy#SID -v -resolve lib\jms.jar lib\com.ibm.mqjms.jar lib\com.ibm.mq.jmqi.jar lib\dhbcore.jar
lib\fscontext.jar src\com\test\javasp\mq\JmsProducer.java
I also tried with -genmissing option with some additional jars ( list I found here ), but still get similar error for a different class.
Other issue with this that I am facing is that if I get an error and try to use the dropjava command from Oracle, it doesn't work either.
I also saw from this link, that this person was successful, but unfortunately, he/she didn't indicate how they used loadjava to load the jars.
If i can provide any other information, please let me know.
If anyoneone has any idea on how to get the Java Stored Procedure to use IBM MQ working with Oracle 11i, I would really appreciate the help.
Found a detailed answer in this blog entry. I tried it and it worked for me.
In Oracle there is no concept of CLASSPATH, so the standard MQ Client install is useless. You can only load the jars reference by your app within the database schema. Classes are resolved when loaded with the -r option. You can further on specify your own resolved using -r -Resolver (schemas). (check Oracle docs for exact format). So in effect the database schemas becomes the classpath.
Using Websphere MQ classes for Java poses a number of problems, you have to ensure that the Oracle JDK version is at an appropriate support level to connect to the chosen MQ server version. Check the system requirements for websphere MQ Vx.x. You should find IBM's web references. check the support for MQ classed for java.
I have such an issue at the moment trying to connect to Mq using Oracle 10 and JDK 1.4.2. I had to recompile my Java code using JDK 1.4.x. This does not work and I assume it is because I connect to MQ 7.0.1.7 which requires JRE 1.7 as minimum.

Categories