当前位置:编程学习 > JSP >>

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


各位高手麻烦帮我看下面这三个文件(一个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;
  //连接池名
补充:Jsp教程,Jsp/Servlet开发工具
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,