About the Tomcat connection pool configuration, Eclipse + Lomboz environment.

xiaoxiao2021-03-06  58

Eclipse Lomboz environment development J2EE project, I have the project name Deepsoft, the web moudle name MYAPPSDeploy will automatically establish the following directory in Tomcat to create a release directory D: / Tomcat5 | ----- / WebApps | ----- - / myApps ---------------------------------------- this directory is automatically generated of. | ------ / Web-INF (1) For clarity and easy management, we configure the .xml file for our database connection pool. D: / tomcat5 | ----- / conf | ------- / catalina This directory will now find root, manager, balance and other directories, open you will find the virtual directory comes with Tomcat Profile. At this time we can build a .xml file for your own project. Note: The file name is recommended to use the project name. I have the project name is deepsoft.xml so I have the configuration file as follows: Deepsoft.xml

driverclassname com.microsoft.jdbc.sqlserver.sqlserverdriver

URL jdbc: Microsoft: SQLServer: //192.168.100.222: 1433; DatabaseName = Deepsoft

Username sa password sa

maxactive 4

maxWait 5000 maxidle 2

For the Oracle database, just change the corresponding URL, DriverClassName. At the same time, it is guaranteed that you have installed the necessary drivers, Oracle's Calss111.jar, and SQL Server's three driver files to Tomcat5 / Common / Lib Directory (2) and then play D: / Tomcat5 / WebApps / MyApps / Web-INF / Web.xml, add the following statement: (Note To add it before )

Oracle Datasource Example JDBC / SQLSERVER javax.sql.datasource < Res-auth> container

NOTICE: NO THIS SENTENCE, You Will Find A Error of "Can't Bound Jndi Name" (3) Notice !!!!!! Configuration Complete Test Page is built as follows.jsp

<% @ page import = "javax.naming.context"%> <% @ page import = "javax.sql.datasource"%> <% @ Page Import = "javax.naming.initialcontext"%> <% @ Page Import = "java.sql. *"%>

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

New Post(0)