Tomcat 5.0.14 The database connection pool configuration, and the common problem and solution of the JNDI search, configuration, and application process of the program.
1. Configuration environment: Tomcat5.0.14 JDK1.42 SQL Server 2000 Win2003
2. Configuration steps:
first step:
Start Tomcat, open IE Enter http: // localhost: 8080 / admin to enter Tomcat management interface in the address bar; click on the drop-down menu on the right side to select Create New Data Source in the lower right input box. Configuration information.
JNDI NAME: JDBC / XXX (XXX is the name yourself ")
Data Source URL: JDBC: Microsoft: SQLSERVER: // localhost: 1433; DatabaseName = Tempdb (connected data name)
JDBC Driver Class: com.microsoft.jdbc.sqlserver.sqlserverdriver
User name: User name to connect to the database
Password: Database password
Max. Active Connections: Maximum connection
Max. Idle Connections: is the maximum number of idle connections
Max. Wait for Connection: Maximum Waiting Connection
Step 2: Configure Web.xml Open Web.xml under WebApps / Root / Web-INF, add the following:
Step 3: Configure Tomcat (add classes)
First you want to download the installation of SQLSerVer-JDBC-driver, then put the three JAR files under its lib.
Under Tomcat / Common / LIB.
Precautions:
If we are a single JSP page we put it under Tomcat_Home / WebApps / root, but also need to modify the root.xml file under Tomcat_Home / Conf / Catalina / LocalHost /
To reference the configured JNDI data source. At the same time,
A: You can create a new xxx.xml file under Tomcat_Home / CONF / CATALINA / LOCALHOST, XXX is the name of the released web application, such as the web application I posted is jnditest, .xml file named jnditest.xml in this file plus:
XML Version = '1.0' encoding = 'UTF-8'?>
parameter>
parameter>
parameter>
parameter>
parameter>
parameter>
parameter>
parameter>
Resourceparams>
Context>
Where E: / Tomcat 5.0 / WebApps / Jnditest is a directory for your publishing application, so you can test it.
Doing this is that every web application must create a file like JNDITEST.XML.
B; To avoid each web application to create a xxx.xml file, we can modify the server.xml file under Tomcat_Home / Conf, modify the following:
Join between
For my cms system, but also to modify propertyset.xml