连接sybase数据库的问题
<Context reloadable = "false">
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>META-INF/context.xml</WatchedResource>
<Resource name="jdbc/mydb" type="javax.sql.DataSource" username="sa" password="123456" driverClassName="com.sybase.jdbc3.jdbc.SybDriver"
url="jdbc:sybase:Tds:localhost:5000/test"/>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
以上是我连接数据库的配置文件,接下来是运行后的错误提示
org.apache.tomcat.dbcp.dbcp.
SQLNestedException: Cannot create PoolableConnectionFactory (JZ006: 捕获到 IO 例外:
java.net.ConnectException: Connection refused: connect)
我用上面同样的配置文件,改成连接MSSQL后就能正常连接数据库了,没连接过SYBASE数据库,请知道的朋友在我现有的配置文件上修改一下,多谢!!!
------解决方案--------------------hibernate.connection.driver_class com.sybase.jdbc3.jdbc.SybDataSource
hibernate.connection.url jdbc:sybase:Tds:132.96.33.49:8888/swsydb?charset=cp936
hibernate.connection.username sjswsydb1
hibernate.connection.password BC819113F0466A714A30AFAB7E2039F1
hibernate.dialect org.hibernate.dialect.SybaseDialect
keyVersion v0.05