Tomcat5.0's data source configuration.

xiaoxiao2021-03-06  33

1. The drive is the class12.zip server actually does not recognize it, not to change to class12.jar

2, configure it through the console.

The information requested by JNDI Name is required, in which other other can be filled in according to your needs. For example, the content of the Data Source URL may be: jdbc: mysql: // ip or name / databasename, where DatabaseName is your database name, IP is the IP or name of the server where your database is located. Finally click Save-> Commit Change. So your basic data of your data source is half configured.

4, Web.xml and% Tomcat_Home% / conf / Catalina / LocalHost, corresponding to your reference configuration file modification

Navigate through the folder to% tomcat_home / conf, open web.xml, add the following in front of ::

DB Connection

jdbc / mysql

javax.sql.datasource

container

Note that the content fill in RES-REF-NAME is consistent with the JNDI Name name mentioned above.

Navigate through the folder to% tomcat_home / conf / Catalina / localhost, find the .xml file corresponding to your web application, such as root.xml, and add the code under this file:

Here, the configuration work is basically completed.

转载请注明原文地址:https://www.9cbs.com/read-81162.html

New Post(0)