一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

JSP用连接池连数据库的问题

时间:2022-07-02 17:55:59 编辑:袖梨 来源:一聚教程网


各位高手麻烦帮我看下面这三个文件(一个jsp,两个.java),我在IE输入地址时,提示如下错误(代码应该没有错,不知是不是设置的问题),望高手指教,不胜感激:
D:Program FilesApache GroupTomcat 4.1workStandalonelocalhost_shoppingindex_jsp.java:44: package mybean does not exist
      mybean.DBConnManager connManager = null;
            ^
An error occurred at line: 2 in the jsp file: /shopping/index.jsp
Generated servlet error:
D:Program FilesApache GroupTomcat 4.1workStandalonelocalhost_shoppingindex_jsp.java:46: package mybean does not exist
        connManager = (mybean.DBConnManager) pageContext.getAttribute("connManager", PageContext.APPLICATION_SCOPE);
                             ^
An error occurred at line: 2 in the jsp file: /shopping/index.jsp
Generated servlet error:
D:Program FilesApache GroupTomcat 4.1workStandalonelocalhost_shoppingindex_jsp.java:49: package mybean does not exist
            connManager = (mybean.DBConnManager) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "mybean.DBConnManager");
                                 ^
//下面这两个是连接池,下面两个文件都放在一个mybean的包里.
package mybean;
import java.sql.*;
import java.util.*;
public class DBConnPool {
  //正在使用连接的数量
  private int using;
  //目前可用的连接数,即空闲连接
  private Vector connections=new Vector();
  //最大连接数
  private int maxconn;
  //连接池名

热门栏目