I am using JDBC to connect to a sybase database. Supposedly the charset used is different on the server's side and this throws an exception. I searched this up and the solution suggested by some, was to include charset=iso_1 in the jdbc URL as a parameter=value pair. That does not seem to work for me. I am using jconn2.jar to load the com.sybase.jdbc2.jdbc.SybDriver driver. Most people seem to have this problem, but at the end of the exception message they get something like roman-8 or UTF8 etc etc. I dont know why I get UnsupportedCharset instead. Shown below is the entire trace.
java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0I6: An error occured converting UNICODE to the charset used by the server. Error message: java.io.CharConversionException: java.io.UnsupportedEncodingException: UnsupportedCharset at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:485) at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3064) at com.sybase.jdbc2.tds.Tds.language(Tds.java:702) at com.sybase.jdbc2.jdbc.SybStatement.sendQuery(SybStatement.java:1425) at com.sybase.jdbc2.jdbc.SybStatement.executeQuery(SybStatement.java:1495) at com.sybase.jdbc2.jdbc.SybStatement.executeQuery(SybStatement.java:402) at com.main.Main.readFrom(Main.java:26) at com.main.Main.main(Main.java:18) Exception in thread "main"
However this exception is not thrown in some of the machines here. I am one of the unfortunate souls to get this. I made sure the library files in all the machines are the same. No use
Anyone have any suggestions ? Has anyone solved this ? [ January 25, 2007: Message edited by: John Meyers ]
The JRE for Solaris and Linux supports all encodings, but JRE for windows comes in 2 versions. US-ONLY and International. While the US-ONLY supports only fewer encodings the International supports all of them.
Would not be a bad idea to try to swith betwen the versions of the JRE.