2013-05-08 5 views
0

저는 sybase에서 초보자입니다. 내 sybase 서버에 간단한 jdbc 연결을 시도하고 있습니다. 아래 코드를 사용하십시오.sybase jdbc 연결 문제

내 수업 경로에도 jcon3.jar이 있습니다.

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(); 
    } 

내가 기대하는 것을 달성 할 수 없습니다. 아래에 내가 받고있는 오류입니다.

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 
+0

데이터베이스에서 사용하는 charset을 검색하여 클라이언트 용으로 설정해보십시오. – Olu

답변

1
  1. 다운로드 드라이버 사이베이스의 최신 버전.
  2. Sybase 드라이버의 i18n.jar 및/또는 charsets.jar를 포함하십시오.