乐乐好好 乐乐好好
关注数: 50 粉丝数: 67 发帖数: 10,325 关注贴吧数: 50
tomcat配置数据库连接池 <!--configure jndi database pool--> <Context path="/test_jndi" docBase="D:/softSetup/jakarta-tomcat-5.0.19/webapps/test_jndi" debug="0" reloadable="true" crossContext="true"> <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_quality_log." suffix=".txt" timestamp="true"/> <Resource name="jdbc/connectDB" auth="Container" type="javax.sql.DataSource"/> <ResourceParams name="jdbc/connectDB"> <parameter>    <name>maxActive</name>    <!-- Maximum number of DB connections in pool.Set to 0 for no limit. -->    <value>100</value> </parameter> <parameter>    <name>maxIdle</name>    <!-- Maximum number of idle DB connections to retain in pool.Set to 0 for no limit. -->    <value>30</value> </parameter> <parameter>    <name>maxWait</name>    <!-- Maximum time to wait for a DB connection to become available in ms.An exception is thrown if this timeout is exceeded.Set to -1 to wait indefinitely. -->    <value>10000</value> </parameter> <parameter>    <name>removeAbandoned</name>    <!-- Abandoned DB connections are removed and recycled -->    <value>true</value> </parameter> <parameter>    <name>removeAbandonedTimeout</name>    <!-- Use the removeAbandonedTimeout parameter to set the number of seconds a DB connection has been idle before it is considered abandoned.   -->    <value>60</value> </parameter> <parameter>    <name>logAbandoned</name>    <!-- Log a stack trace of the code which abandoned -->    <value>false</value> </parameter> <parameter>    <name>factory</name>    <!--DBCP Basic Datasource Factory -->    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> </parameter> <parameter>    <name>username</name>    <!-- Database User Name -->    <value>root</value> </parameter> <parameter>    <name>password</name>    <!-- User Password -->    <value>pwd</value> </parameter> <parameter>    <name>driverClassName</name>    <!-- Database Driver Class Name -->    <!--<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>     <value>oracle.jdbc.driver.OracleDriver</value>      <value>org.gjt.mm.mysql.Driver</value>--> <!---for mysql,both config style are okay-->
首页 1 2 下一页