Set the database connection pool environment based on tomcat5.5 (for future generations)
Source: Internet
Author: User
1. Admin package tomcat5.5 installed in tomcat5.5 is not installed by default, first download admin package jakarta-tomcat-5.5.9-admin.zip jakarta-tomcat-5.9-admin.tar.gz (the two packages should be the same, http://mirrors.uol.com.br/pub/apache/jakarta/tomcat-5/v5.5.9/bin ).
Set/CONF/Catalina/localhost/admin. copy XML to the directory % java_home % \ conf \ Catalina \ localhost \, and copy the server/webapps/admin folder to the directory % java_home % \ Server \ webapps. In addition, the release-notes, notice, and license can be directly copied to the % java_home % directory. I don't know if it is necessary. You can try it on your own. This completes the installation of the Admin package.
2. After the admin package is installed, you can enter http: // localhost: 8080/admin. First, enter a login window. The default username is admin and the password is blank. You can change the password when installing Tomcat. After entering, find data sources, click, and select create new data source in data source actions on the right. The following information is to be filled in.
(Example) if you install Ms JDBC;
JNDI name: JDBC/sqlserver data source URL: JDBC: Microsoft: sqlserver: // localhost: 1433; databasename = sqlserver JDBC Driver Class: COM. microsoft. JDBC. sqlserver. sqlserverdriver driver Name User name: SA // database login user name and password: SA Max. active connections: 4 Max. idle connections: 2 max. wait for connection: 5000 validation query: If you have installed jtds; JNDI name: JDBC/sqlserver data source URL: JDBC: jtds: sqlserver: // localhost: 1433/sqlserver where sqlserver is your database name JDBC Driver Class: net. sourceForge. jtds. JDBC. driver driver Name User name: SA // database login user name and password: SA Max. active connections: 4 Max. idle connections: 2 max. wait for connection: 5000 validation query:
3. In the file configuration, navigate to % atat_home % \ conf in the folder, open web. XML, and add the following content before: DB connection JDBC/sqlserver javax. SQL. datasource container
Note that the res-ref-name must be the same as the JNDI name mentioned above. After the configuration is complete, restart tomcat, find the corresponding configuration file context. xml under % java_home % \ webapps \ Root \ META-INF, and check its content.
The following is the reference information.
WEB-INF/web. XML WEB-INF/web. if XML is an old version, navigate to % atat_home % \ conf \ Catalina \ localhost in the folder and find the corresponding content of your web application. XML files, such as xmdc. XML, and add a line before this file Code :
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.