buttowski
buttowski

Reputation: 4907

sybase jdbc connection issue

i am just a beginner in sybase. am trying make a simple jdbc connection to my sybase server. using below code.

i have jcon3.jar in my classpath too.

try {
        Class.forName("com.sybase.jdbc3.jdbc.SybDataSource");
        System.out.println("before connection");
        Connection conn = DriverManager.getConnection("jdbc:sybase:Tds:localhost:1326/db","butt","clear");
        System.out.println("after connection");
    } catch (Exception e) {
        e.printStackTrace();
    }

i am not able achieve what i expect. below is the error i am getting.

inside try
before connection
java.sql.SQLException: JZ00L: Login failed.  Examine the SQLWarnings chained to this exception for the reason(s).
    at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(Unknown Source)
    at com.sybase.jdbc3.tds.Tds.for(Unknown Source)
    at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
    at com.sybase.jdbc3.tds.Tds.login(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybConnection.a(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybConnection.a(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybConnection.<init>(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybConnection.<init>(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at com.risk.JDBC.TestJdbc.main(TestJdbc.java:19)
SQL Error : State=[JZ00L] JZ00L: Login failed.  Examine the SQLWarnings chained to this exception for the reason(s).
SQL Error : State=[JZ0IB] JZ0IB: The server's default charset of roman8 does not map to an encoding that is available in the client Java environment. Because jConnect will not be able to do client-side conversion, the connection is unusable and is being closed. Try using a later Java version, or try including your Java installation's i18n.jar or charsets.jar file in the classpath.
SQL Error : State=[JZ006] JZ006: Caught IOException: java.io.CharConversionException: java.io.UnsupportedEncodingException: hp-roman8

Upvotes: 0

Views: 22762

Answers (1)

user2362987
user2362987

Reputation:

  1. Download Sybase's latest version of the driver.
  2. Include the Sybase driver's i18n.jar and/or charsets.jar.

Upvotes: 1

Related Questions