JSP用串連池連資料庫的問題
來源:互聯網
上載者:User
各位高手麻煩幫我看下面這三個檔案(一個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;
//串連池名