当前位置: 代码迷 >> Java Web开发 >> java 如何连接数据库
  详细解决方案

java 如何连接数据库

热度:4350   发布时间:2013-02-25 21:14:34.0
java 怎么连接数据库.
2012-7-5 14:21:26 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;C:\Program Files\Genuitec\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_8.5.0.me201003121946\tomcat\bin
2012-7-5 14:21:26 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2012-7-5 14:21:26 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 352 ms
2012-7-5 14:21:26 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2012-7-5 14:21:26 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.13

------------------------------------------------------------

严重: Exception sending context initialized event to listener instance of class com.cs.api.init.APIInitListener
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory ([Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.)

------------------------------------------------------------
以上是提示的信息.没弄过java.百度没结果.

------解决方案--------------------------------------------------------
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory ([Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.)

查一下 ,你的sql Server 2000 服务器启动了没有 ?

查一下网络通不通 ?
------解决方案--------------------------------------------------------
可能是网络或服务没启动造成的。
------解决方案--------------------------------------------------------
看看这个com.cs.api.init.APIInitListener文件在配置文件中是否正确
------解决方案--------------------------------------------------------
配置文件是否正确。
  相关解决方案