日期:2014-05-18  浏览次数:21024 次

sybase 连接查询出现Site 'localhost' not found in sysserver错误
连接代码
Java code
<property name="hibernate.connection.url">jdbc:sybase:Tds:192.168.0.106:5002/SPJG?charset=utf8</property>
        <property name="hibernate.connection.driver_class">com.sybase.jdbc3.jdbc.SybDriver</property>
        <property name="hibernate.connection.username">sa</property>
        <property name="hibernate.connection.password"></property>

错误信息
Java code
org.hibernate.exception.GenericJDBCException: could not execute query
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.loader.Loader.doList(Loader.java:2235)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
    at org.hibernate.loader.Loader.list(Loader.java:2124)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)。。。。。。。。。。。
Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Site 'localhost' not found in sysservers.

    at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
    at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
    at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybStatement.queryLoop(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybStatement.executeQuery(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeQuery(Unknown Source)



------解决方案--------------------
sybase的jdbc驱动你装了不的
如果装了,那么开个传送门
SQL code
sybase
go