[Database Study Notes] (4) JDBC data source and connection pool, learning notes jdbc

Source: Internet
Author: User

[Database Study Notes] (4) JDBC data source and connection pool, learning notes jdbc










Different database connection pool and JDBC

Simply put, a link pool creates many links and stores them in a pool. You can retrieve them from the pool when using them, and put them back in the pool when you don't need them. The links in this pool are created using various methods, including those created using jdbc.

Problems with connection pool connection to mysql when using data sources in Servlet JDBC

Configuring the data source in context. xml under the META-INF is of course useless.
Configure the data source in conf/server. xml under the tomcat installation directory,
The format is <Context>
<Resource name = "jdbc/mydb" auth = "container"
Type = "javax. SQL. DataSource" maxActive = "1000"
MaxIdle = "30" maxwait= "10000"
Username = "root" password = "wangxu456753" driverClass = "com. mysql. jdbc. Driver"
Url = "jdbc: mysql: // localhost: 3306/mydb? AutoReconnect = true ">
</Resource>
</Context>

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.