Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to postflat modethreaded modego to previous topicgo to next topicgo to back
作者 SQLServer 2000 Driver for JDBC]Error establishing socket
voit25





发贴: 7
于 2006-04-28 14:45 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我的原文件::

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.io.*"%>
<html>
<body>
以下是从Ms sql server数据库读取的数据:<hr>
<table border=1>
<tr><td>id</td></tr>
<%

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
Connection con=java.sql.DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=voit25","sa","");
Statement stmt=con.createStatement();
ResultSet rst=stmt.executeQuery("select * from ID;");
while(rst.next())
{
   out.println("<tr>");
   out.println("<td>"+rst.getString("name")+"</td>");

   out.println("</tr>");
}
//关闭连接、释放资源
rst.close();
stmt.close();
con.close();
%>
</table>
</body>
</html>

错误是:::

Exception report

message

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

exception

javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
  org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:845)
  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:778)
  org.apache.jsp.conn_jsp._jspService(conn_jsp.java:77)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
  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(DriverManager.java:512)
  java.sql.DriverManager.getConnection(DriverManager.java:171)
  org.apache.jsp.conn_jsp._jspService(conn_jsp.java:53)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


YuLimin edited on 2006-05-02 10:26



话题树型展开
人气 标题 作者 字数 发贴时间
1360 SQLServer 2000 Driver for JDBC]Error establishing socket voit25 3296 2006-04-28 14:45
1256 Re:SQLServer 2000 Driver for JDBC]Error establishing socket YuLimin 355 2006-05-02 10:25

reply to postflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923