[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>