javax.servlet.ServletException: No ResultSet was produced

linuxguoyy 2002-04-16 06:01:26
Error: 500
Location: /cjy/user_manage/insert_user.jsp
Internal Servlet Error:

javax.servlet.ServletException: No ResultSet was produced
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)
at cjy.user_0005fmanage._0002fcjy_0002fuser_0005fmanage_0002finsert_0005fuser_0002ejspinsert_0005fuser_jsp_9._jspService(_0002fcjy_0002fuser_0005fmanage_0002finsert_0005fuser_0002ejspinsert_0005fuser_jsp_9.java:121)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)

-------------------------------------------------------
<%@page import="java.sql.*" %>
<%@include file="../inc/header.jsp"%>
<%
//String jgbm=new String();
String yhid=new String();
String yhmm=new String();
String yhxm=new String();
String jsdm=new String();
String yhzt;
//out.print(session.getAttribute("JGBM"));
String jgbm=(String)session.getAttribute("JGBM");//"44444:";
yhid=request.getParameter("yhid");
yhmm=request.getParameter("yhmm");
yhxm=request.getParameter("yhxm");
jsdm=request.getParameter("jsdm");
yhzt="1";

String SQL;
String sql1;
SQL="select * from tCJ_YHXX where YHID='"+yhid+"'";
Statement stmt6=con.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY);
ResultSet rs=stmt6.executeQuery(SQL);
if(!rs.next()){
sql1="insert into tCJ_YHXX values('"+yhid+"','"+yhmm+"','"+yhxm+"','"+jgbm+"','"+jsdm+"','"+yhzt+"')";
stmt6.executeQuery(sql1);
try{
ResultSet rs3=stmt6.executeQuery(sql1);}
catch(Exception e){
System.err.println("aq.executeQuery: " + e.getMessage());
}
response.sendRedirect("local_admin.jsp");
}
else{
out.print("<center><input type='button' onclick='history.back();' value='此用户ID已经存在,返回修改'></center>");
}


...全文
7 点赞 收藏 2
写回复
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
linuxguoyy 2002-04-17
不行啊
回复
tyscon 2002-04-16
两个stmt6应该会出问题,因为你是在第一个里面使用第二个stmt6,应该使用不同的statement,你试一下。
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告