首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]Error

2013-09-11 
javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socke

javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
HTTP   Status   500   -  

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

type   Exception   report

message  

description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception  

org.apache.jasper.JasperException:   Exception   in   JSP:   /test.jsp:13

10:   //pubs为你的数据库的  
11:   String   user= "sa ";  
12:   String   password= " ";  
13:   Connection   conn=   DriverManager.getConnection(url,user,password);  
14:  
15:   out.print(conn);
16:   Statement   stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);  


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root   cause  

javax.servlet.ServletException:   [Microsoft][SQLServer   2000   Driver   for   JDBC]Error   establishing   socket.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root   cause  

java.sql.SQLException:   [Microsoft][SQLServer   2000   Driver   for   JDBC]Error   establishing   socket.
com.microsoft.jdbc.base.BaseExceptions.createException(Unknown   Source)
com.microsoft.jdbc.base.BaseExceptions.getException(Unknown   Source)
com.microsoft.jdbc.base.BaseExceptions.getException(Unknown   Source)
com.microsoft.jdbc.sqlserver.tds.TDSConnection. <init> (Unknown   Source)
com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown   Source)
com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown   Source)
com.microsoft.jdbc.base.BaseConnection.open(Unknown   Source)
com.microsoft.jdbc.base.BaseDriver.connect(Unknown   Source)
java.sql.DriverManager.getConnection(Unknown   Source)
java.sql.DriverManager.getConnection(Unknown   Source)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:55)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/5.5.14   logs.




[解决办法]
Connection conn= DriverManager.getConnection(url,user,password);

Statement stmt=conn.createStatement
这两句最好分别用TRY CATCH包起来.捕捉SQLException异常.....
[解决办法]
你是不是没打sp3朴钉呢?
[解决办法]
你是不是没打sp3朴钉呢?
你是不是没打sp3朴钉呢?
你是不是没打sp3朴钉呢?
你是不是没打sp3朴钉呢?
[解决办法]
1.补丁SP3打了吗?
 2.CMD下使用netstat 命令查看默认端口1433打开了吗?
 3.未知中.....
[解决办法]
1.使用JDBC FOR MSSQL 2000的SP3驱动了吗?
2.使用MS SQL 2000的SP4补丁包了吗
3.你的连接的IP地址正确吗
[解决办法]
C:\> netstat

Active Connections

Proto Local Address Foreign Address State
TCP WWW-B442A6BE7A4:1043 62.241.53.16:4242 ESTABLISHED
TCP WWW-B442A6BE7A4:2296 72.5.124.55:http ESTABLISHED
TCP WWW-B442A6BE7A4:2302 121.25.78.250:4665 ESTABLISHED
TCP WWW-B442A6BE7A4:2423 72.5.124.55:http ESTABLISHED
TCP WWW-B442A6BE7A4:2425 72.5.124.55:http ESTABLISHED
TCP WWW-B442A6BE7A4:4112 211.100.26.121:http CLOSE_WAIT
TCP WWW-B442A6BE7A4:4113 211.100.26.121:http CLOSE_WAIT
TCP WWW-B442A6BE7A4:4114 211.100.26.121:http CLOSE_WAIT
TCP WWW-B442A6BE7A4:4115 211.100.26.121:http CLOSE_WAIT
TCP WWW-B442A6BE7A4:4119 211.100.26.75:http ESTABLISHED
TCP WWW-B442A6BE7A4:4126 211.100.26.68:http ESTABLISHED
TCP WWW-B442A6BE7A4:4228 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4231 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4232 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4234 211.100.26.124:http TIME_WAIT
TCP WWW-B442A6BE7A4:4236 211.100.26.124:http TIME_WAIT
TCP WWW-B442A6BE7A4:4237 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4241 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4242 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4243 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4247 211.100.26.124:http TIME_WAIT
TCP WWW-B442A6BE7A4:4251 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4253 211.100.26.74:http TIME_WAIT
TCP WWW-B442A6BE7A4:4256 211.100.26.124:http TIME_WAIT
TCP WWW-B442A6BE7A4:4258 211.100.26.124:http TIME_WAIT
TCP WWW-B442A6BE7A4:4260 211.100.26.124:http TIME_WAIT
TCP WWW-B442A6BE7A4:4261 211.100.26.124:http TIME_WAIT
TCP WWW-B442A6BE7A4:4263 211.100.26.124:http TIME_WAIT
TCP WWW-B442A6BE7A4:4265 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4266 211.100.26.123:http TIME_WAIT
TCP WWW-B442A6BE7A4:4267 60.2.169.142:6254 SYN_SENT
TCP WWW-B442A6BE7A4:4269 218.77.17.148:6257 ESTABLISHED
TCP WWW-B442A6BE7A4:4783 58.47.17.213:48471 ESTABLISHED
TCP WWW-B442A6BE7A4:4783 61-230-161-169.dynamic.hinet.net:4038 ESTABLISH
ED
TCP WWW-B442A6BE7A4:4783 124.248.32.189:3430 ESTABLISHED
TCP WWW-B442A6BE7A4:4783 220.172.104.34:18817 ESTABLISHED
TCP WWW-B442A6BE7A4:4783 50.15.184.222.broad.ha.js.dynamic.163data.com.cn


:27053 ESTABLISHED

C:\>

=============================================
看看我这个开了没呢?



[解决办法]
看上去java这边是对的,数据库这边有问题。

1.登录模式改成混合模式
2.打开1433端口

或者打上sp4补丁,补丁自动会替你做这些操作。
[解决办法]
应该用netstat -an看看有没有1433这个端口
[解决办法]
怎么打开1433端口啊
[解决办法]
是JSP里出的问题,看看你/test.jsp:13行是什么代码?你是在JSP中直接连接数据库的吗?请检查WEB-INF\lib下面有没有数据库驱动,还有就是把数据库连接代码部分try-catch起来,在终端看异常的位置。
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html

热点排行