日期:2014-05-18  浏览次数:20770 次

问题:为什么在对数据库进行操作时,用第一个IE能操作成功,而再打开第二个IE不能进行操作,但第一个还是可以正常操作。
出现下列错误
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
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
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.lang.NullPointerException
org.apache.jsp.in_jsp._jspService(in_jsp.java:85)
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)
note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/5.0.30   logs.
--------------------------------------------
Apache   Tomcat/5.0.30

问题:为什么在对数据库进行操作时,用第一个IE能操作成功,而再打开第二个IE不能进行操作,但第一个还是可以正常操作。
小弟才接触JSP,各位多多指点~~,有那些应注意的地方,就直说~~

备注:jsp+mysql   5.0+tomcat   5.0;
架构:jsp+javabean+database;

文件名为:in.jsp
类名为:DBConn.class

类源文件和jsp源文件如下
package   huo;
import   java.sql.*;
import   java.lang.*;
import   java.io.*;
import   java.util.*;
public   class   DBConn{
String   dbname= "a ";
String   dburl= "jdbc:mysql://localhost/ ";
String   dbuser= "root ";
String   dbpwd= "r ";
Connection   con=null;
ResultSet   rs=null;
Statement   stm=null;
public   DBConn(){
try{
Class.forName( "com.mysql.jdbc.Driver ");
}catch(java.lang.ClassNotFoundException   e){
System.out.println( "加载驱动失败 ");
}
}//end   DBConn

public   void   ConnDB(String   dbname,String   dburl,String   dbuser,String   dbpwd){//数据库名,地址,用户名和密码
this.dburl=dburl+dbname;
this.dbuser=dbuser;
this.dbpwd=dbpwd;
try{
this.con=DriverManager.getConnection(this.dburl,this.dbuser,this.dbpwd);
//this.con=con;
this.stm=con.createStatement();
//this.stm=stm;
}catch(SQLException   e){
System.out.println( "数据库连接失败 ");
}
}//end   ConnDB
public   ResultSet   executQuery(String   sql){
try{

rs=this.stm.executeQuery(sql);
}
catch(SQLException   ex){
//