aspose file tools*
The moose likes JDBC and the fly likes UnsupportedCharset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "UnsupportedCharset" Watch "UnsupportedCharset" New topic
Author

UnsupportedCharset

Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

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 ]

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Rajesh Agarwal
Ranch Hand

Joined: Aug 01, 2005
Posts: 79
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.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Ahhh i never thought of that. I did read about the English and International versions. Will try to switch them and let you know. Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: UnsupportedCharset