连接数据库时出错:
StandardWrapperValve[action]: Servlet.service() for servlet action threw exceptionjava.lang.RuntimeException: get connection error![Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.java.lang.RuntimeException: get connection error![Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. at cn.com.studio.system.DBBean.initConnection(DBBean.java:71) at cn.com.studio.system.DBBean.getConnection(DBBean.java:56) at cn.com.studio.login.service.LoginServiceImpl.userLogin(LoginServiceImpl.java:42) at cn.com.studio.login.action.LoginAction.userLogin(LoginAction.java:75) at cn.com.studio.login.action.LoginAction.execute(LoginAction.java:38) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534)
.是什么原因,数据库在我本地,已经启动.

解决方案 »

  1.   

    3个驱动JAR包我是从别的机器上考过来的.放在工程的CLASSPATH下.
      

  2.   

    如果你的服务器是windows2003的,sql要打到sp4才可以!
      

  3.   

    我是WINDOWXP,打到SP3,
    数据库连接
    driver:com.microsoft.jdbc.sqlserver.SQLServerDriver
    user:sa
    passwd:saClass.forName(driver).newInstance();
    conn = DriverManager.getConnection(url, user, passwd);
    还是一样的错误
      

  4.   

    url:jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=DB_JXC