Connection to the database using the connection pool of JSP

Source: Internet
Author: User


You can take a look at the three files below (one jsp and two. java), when I enter the address in IE, the following error is prompted (the code should be correct, and I don't know if it is set). I am very grateful for the high finger instruction:
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 ");
^
// The following two are connection pools, and the following two files are placed in a mybean package.
Package mybean;
Import java. SQL .*;
Import java. util .*;
Public class DBConnPool {
// Number of connections in use
Private int using;
// Currently available connections, that is, idle connections
Private Vector connections = new Vector ();
// Maximum number of connections
Private int maxconn;
// Connection pool name

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.