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

求大神相助!

2012-11-20 
求大神帮助!!!package readmission.fileimport javax.servlet.http.*import javax.servlet.jsp.*import

求大神帮助!!!
package readmission.file;
 
 
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;

import javax.servlet.*;

import validata.ValidataNumber;

import java.util.* ;
import java.io.* ;
import include.nseer_db.*;
import include.nseer_cookie.*;
import include.operateDB.CdefineUpdate;

public class outincount_ok extends HttpServlet{

public synchronized void service(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{
HttpSession dbSession=request.getSession();
JspFactory _jspxFactory=JspFactory.getDefaultFactory();
PageContext pageContext = _jspxFactory.getPageContext(this,request,response,"",true,8192,true);
ServletContext dbApplication=dbSession.getServletContext();
ServletContext application;
HttpSession session=request.getSession();
nseer_db_backup1 readmission_db=new nseer_db_backup1(dbApplication);
nseer_db_backup1 finance_db=new nseer_db_backup1(dbApplication);
ValidataNumber validata=new ValidataNumber();
counter count=new counter(dbApplication);
String sql3="select * from readmission_patient";
ResultSet rs=readmission_db.executeQuery(sql3);
String start_time=request.getParameter("start_time");
String end_time=request.getParameter("end_time");
String[] medicalnum=new String[100];
int lcount=0;
try{
if(readmission_db.conn((String)dbSession.getAttribute("unit_db_name")))
{
int yes1=end_time.compareTo(start_time);
if(yes1>0)
{
rs.next();
String register_in_time=rs.getString("register_in_time");
System.out.println("register_in_time");
int yes2=register_in_time.compareTo(start_time);
if(yes2>=0)
{
int yes3=register_in_time.compareTo(end_time);
while(yes3<=0)
{
medicalnum[lcount]=rs.getString("mediacl_num");
lcount++;
System.out.println("mediacl_num"+lcount);
rs.next();
rs.getString("register_in_time");
yes3=register_in_time.compareTo(end_time);
}
//String sql = "insert into readmission_patient(medical_num,hospital_num,name,sex,age,tel,card,address,state,anamnesis,remarks1,sections,bunk_num,remarks2,register,register_in_time,register_out_time) values ('"
//+medical_num+"','"+hospital_num+"','"+name+"','"+sex+"','"+age+"','"+tel+"','"+card+"','"+address+"','"+state+"','"+anamnesis+"','"+remarks1+"','"+sections+"','"+bunk_num+"','"+remarks2+"','"+register+"','"+register_in_time+"','"+register_out_time+"','"+"')";
response.sendRedirect("readmission/file/outincount_ok.jsp");
}
}
else
response.sendRedirect("readmission/file/outincount_not_ok.jsp");
}
else
response.sendRedirect("readmission/file/outincount_not_ok.jsp");
readmission_db.close();
  }catch (Exception ex){
  ex.printStackTrace();
  }
  }

运行到ResultSet rs=readmission_db.executeQuery(sql3);报错就不往下执行了!
报错为:at include.nseer_db.nseer_db_backup1.executeQuery(nseer_db_backup1.java:100)
at readmission.file.outincount_ok.service(outincount_ok.java:45)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at include.anti_repeat_submit.SubmitFilter.doFilter(SubmitFilter.java:85)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)


at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)


[解决办法]
目测没有开启事务啊
[解决办法]
你得把报的什么样的Exception贴出来。。。

热点排行