Tomcat6 adds the MySQL JNDI Data Source

Source: Internet
Author: User
Tags mysql delete
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

    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.