Tomeat6.0 Connection Pool Database Configuration

Source: Internet
Author: User

In the tomeat6.0 root directory \ conf \ context. xml file, add <resource> information to the <context> node.

<Resource Name = "JDBC/books"
Auth = "Container"
Type = "javax. SQL. datasource"
Username = "sa"
Password = "sa"
Driverclassname = "com. Microsoft. sqlserver. JDBC. sqlserverdriver"
Url = "JDBC: sqlserver: // localhost: 1433; databasename = restrant"
Maxactive = "2" maxwait= "10000"
Maxidle = "1"/>

The JNDI name of the resource specified by naem
Auth specifies the manager for resource management. It has two optional values: container and application. Container indicates that resources are created by containers, and application indicates that resources are created and managed by web applications.
Type specifies the Java class name to which the resource belongs
Maxactive specifies the maximum number of active database connections in the database connection. The value is 0. Unlimited
Maxidle specifies the maximum number of idle database connections in the database connection pool. The value is 0. Unlimited
Maxwait specifies the maximum idle time (in milliseconds) for the database connection in the database connection. If this time is exceeded, an exception is thrown. The value is-1, indicating unlimited waiting.
Username specifies the username used to connect to the database

Password: password used to connect to the database

Driverclassname: Specifies the JDBC driver used to connect to the database.Program

URL specifies the URL to connect to the database

// Driverclassname and URL are written in sql2005.

// This configuration also requires a driver file. The JDBC driver must be copied to the common \ lib directory of tomeat.

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.