Menu

#514 Could not find a Java charset equivalent to collation 0904D0

v1.2
closed
momo
5
2014-09-19
2007-02-01
Bill Brown
No

Greetings:

We are getting this error trying to connect to SQLServer 2000 with jtds 1.2. we are jdk 1.4build10 and it also fails on jdk 1.5. Do you how to work around this? Do we need to set the charset on the datasource? What is an example string we can use to set the datasource? "UTF-8"? Thanks for your help.

java.sql.SQLException: Could not find a Java charset equivalent to collation 0904D00034.
at net.sourceforge.jtds.jdbc.CharsetInfo.getCharset(CharsetInfo.java:190)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.setCollation(ConnectionJDBC2.java:1308)
at net.sourceforge.jtds.jdbc.TdsCore.tdsEnvChangeToken(TdsCore.java:3180)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2248)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:606)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at net.sourceforge.jtds.jdbcx.JtdsDataSource.getConnection(JtdsDataSource.java:281)
at net.sourceforge.jtds.jdbcx.JtdsDataSource.getPooledConnection(JtdsDataSource.java:355)</init></init>

Discussion

  • Brian Heineman

    Brian Heineman - 2007-08-05

    Logged In: YES
    user_id=716174
    Originator: NO

    Bill,

    It appears your database LCID is 1033 which should be mapped to Cp1252 and this has an appropriate mapping in Charsets.properties so I am unclear as to why you are getting this exception. Could you create a small Java test program that creates a database with the collation you are using and demonstrates this failure?

    Cheers,
    -Brian

     
  • momo

    momo - 2009-08-04

    I'm closing this bug due to not being able to reproduce the problem. If someone is able to provide an appropriate test case or at least confirm it still exists, I'll be happy to reopen it.

     
  • John Doe

    John Doe - 2014-09-19

    It back again!

    I use jtds 1.3.1 and MS SQL Server 2008 Express.
    My DB collation is Uzbek_Latin_90_CI_AS. So when I try to connect I get this:

    java.sql.SQLException: Could not find a Java charset equivalent to collation 4304D01000.
    at net.sourceforge.jtds.jdbc.CharsetInfo.getCharset(CharsetInfo.java:198)
    at net.sourceforge.jtds.jdbc.JtdsConnection.setCollation(JtdsConnection.java:1553)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsEnvChangeToken(TdsCore.java:3387)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2445)
    at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:649)
    at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:371)
    at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)</init>

    Connection with MS JDBS lib has no problem.

     

Log in to post a comment.

MongoDB Logo MongoDB