Add the JDBC driver mysql-connector-java-5.1.6.jar of MySQL to the lib directory of Tomcat, otherwise Tomcat will report an exception that cannot find the driver class.
Add the JDBC driver mysql-connector-java-5.1.6.jar of MySQL to the lib directory of Tomcat, otherwise Tomcat will report an exception that cannot find the driver class.
Homepage → Database Technology
Background:
Read News
Tomcat6 adds the MySQL JNDI Data Source
[Date: 2012-12-28] Source: Linux community Author: dc_726 [Font:]
1. Add the JNDI configuration file to the Project
Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: aop = "http://www.springframework.org/schema/aop"
Xmlns: tx = "http://www.springframework.org/schema/tx" xmlns: jdbc = "http://www.springframework.org/schema/jdbc"
Xmlns: context = "http://www.springframework.org/schema/context"
Xmlns: util = "http://www.springframework.org/schema/util">
2. Add the database connection configuration in Tomcat. The specific location is/conf/context. xml under the Tomcat installation directory.
Note that the name must correspond to the second half of java: comp/env in jndiName in the above Spring configuration file.
Auth = "Container" type = "javax. SQL. DataSource"
Password = "test" username = "test"
DriverClassName = "com. mysql. jdbc. Driver"
Url = "jdbc: mysql: // 192.168.229.97: 3306/test"
MaxActive = "100" maxIdle = "30" maxWait = "5000"/>
3. Add the JDBC driver mysql-connector-java-5.1.6.jar of MySQL to the lib directory of Tomcat, otherwise Tomcat will report an exception that cannot find the driver class.
0
DBCP reports an error because MySQL closes the connection automatically.
How does MySQL Delete binlog and restore Data?
Related information: Tomcat Tomcat6 JNDI data source JNDI Data Source
Image Information
View All comments in this article (0)
Comments
Latest Information
Popular this week
Introduction to Linux community-advertisement service-website map-help Info-contact us
The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.
Copyright©2006-2014 Linux community All rights reserved Zhejiang ICP backup No. 06018118