Tomcat graphical interface configuration Mysql database connection pool

Source: Internet
Author: User

Document

1. Start the Tomcat server, open the browser, and enter http: // localhost: 8080/admin/(localhost is the name server or host) to go To the login page of the management interface, in this case, enter the user name and password required during the original installation and log on to the management interface.

2. Select Resources-Data sources to go to the Data source configuration page. Select
Data Source Actions-> select Create New Data Source to go to the configuration details page.
 
3. modify \ conf \ context. xml with the following content:

Reference content is as follows:
<Context>
<Resource name = "jdbc/mysql"
Auth = "Container"
Type = "javax. SQL. DataSource"
DriverClassName = "org. gjt. mm. mysql. Driver"
Url = "jdbc: mysql: // 192.168.1.89/DB"
Username = "root"
Password = "19830918"
MaxActive = "4"
MaxIdle = "2"
MaxWait = "500" type = "codeph" text = "/codeph"/>
</Context>

4. modify web. xml

Open % atat_home % \ conf \ web. xml and add the following content before it:

Reference content is as follows:
<Resource-ref>
<Description> DB Connection </description>
<Res-ref-name> jdbc/mysql </res-ref-name>
<Res-type> javax. SQL. DataSource </res-type>
<Res-auth> Container </res-auth>
</Resource-ref>
Note that the res-ref-name must be the same as the JNDI Name mentioned above. Now, the configuration is complete!

5. Use "java: comp/env/jdbc/mysql" to reference JNDI ";
You can directly apply the JNDI name, such as weblogic8. TOMCAT does this.

Vi. JDBC driver mysql-connector-java- 5.0.0 Beta-bin.jar
Be sure to place it under % atat_home % \ common \ lib.
Restart your Tomcat service.

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.