请求支持,高手帮我看看这是什么错误,应该怎么解决

keller_7910 2004-09-17 01:49:42
register.jsp文件
<%@ page contentType="text/html; charset=GBK"%>
<%@ page language="java" import="java.sql.*"%>
<jsp:useBean id="RegisterBean" scope="page" class="opendb.opendb" />
<%
RegisterBean.getConnection();
String username=request.getParameter("username");
String password=request.getParameter("password");
String sex=request.getParameter("sex");
String education=request.getParameter("education");
String email=request.getParameter("email");
String resume=request.getParameter("resume");
String sql="insert into user(username, password, sex, education, email, resume) values ('"+username+"', '"+password+"', '"+sex+"', '"+education+"', '"+email+"', '"+resume+"')";
RegisterBean.executeUpdate(sql);
out.println("注册成功");
%>
---------------------------
错误信息
org.apache.jasper.JasperException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection reset
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)


...全文
66 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
keller_7910 2004-09-17
我重新启动n次了





------------------------------
回复人: redlaputa(吾心如秋思,爱随雨后归) ( ) 信誉:105
Connection reset
重启你的服务器,如果还是不行,看看连接有没有释放调
回复
redlaputa 2004-09-17
Connection reset

重启你的服务器,如果还是不行,看看连接有没有释放调
回复
keller_7910 2004-09-17
这是我的javabean, 我加了

package opendb;

import java.sql.*;

public class opendb {

String sDBDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String sConnStr = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=zhang";

Connection conn = null;
ResultSet rs = null;
Statement stmt = null;


public void getConnection() throws SQLException{
try {
Class.forName(sDBDriver);
}
catch (java.lang.ClassNotFoundException e) {
System.err.println("opendb(): " + e.getMessage());
}

conn=DriverManager.getConnection(sConnStr,"sa","");

}

public ResultSet executeQuery(String sql) {
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
}
catch (SQLException ex) {
System.err.println("aq.executeQuery: " + ex.getMessage());
}
return rs;
}

public void executeUpdate(String sql){
try {
stmt = conn.createStatement();
stmt.executeUpdate(sql);
}
catch (SQLException ex) {
System.err.println("aq.executeQuery: " + ex.getMessage());
}
}

public void close(){
try {
rs.close();
stmt.close();
conn.close();
}
catch(Exception e){}
}
}

-----------------------------------------------------------------------
回复人: wangwei8117(Jack_David) ( ) 信誉:100
你在数据库操作里面加上try,catch捕捉异常看看是什么原因!


回复
wangwei8117 2004-09-17
你在数据库操作里面加上try,catch捕捉异常看看是什么原因!
回复
keller_7910 2004-09-17
我不知道我具体的哪里做了

我把msbase/mssqlserver/msutil.jar文件放在了tomcat\common\lib下了
classpath环境也配置好了
.;C:\j2sdk1.4.2\lib\dt.jar;C:\j2sdk1.4.2\lib\tools.jar;c:\j2sdk1.4.2\jre\lib\rt.jar;c:\Tomcat 4.1\common\lib\msbase.jar;c:\Tomcat 4.1\common\lib\mssqlserver.jar;c:\Tomcat 4.1\common\lib\msutil.jar;
他还报这种错误,我不知道我哪里个环节弄错了


----------------------------------
回复人: learnner( ) ( ) 信誉:105 2004-09-17 14:09:00 得分: 0
org.apache.jasper.JasperException: [Microsoft][SQLServer 2000 Driver for JDBC]

搂主要自己学会看错误信息啊
回复
learnner 2004-09-17
org.apache.jasper.JasperException: [Microsoft][SQLServer 2000 Driver for JDBC]

搂主要自己学会看错误信息啊
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2004-09-17 01:49
社区公告
暂无公告