当前位置: 代码迷 >> Java Web开发 >> tomcat5配置连接池的有关问题
  详细解决方案

tomcat5配置连接池的有关问题

热度:63   发布时间:2016-04-17 16:04:15.0
tomcat5配置连接池的问题
谁能给我讲下应该注意的问题.
在把配置成功过的   server.xml   文件代码给我帖出来.
小弟太笨了,多谢各位了.

------解决方案--------------------
如果是5.0的话你可以到控制台去配置,如果是5.5的话那中有上网找找了,我用的是5.0所以不知道5.5的怎么配
server.xml
<?xml version= '1.0 ' encoding= 'utf-8 '?>
<Server>
<Listener className= "org.apache.catalina.mbeans.ServerLifecycleListener "/>
<Listener className= "org.apache.catalina.mbeans.GlobalResourcesLifecycleListener "/>
<GlobalNamingResources>
<Environment name= "simpleValue " type= "java.lang.Integer " value= "30 "/>
<Resource auth= "Container " description= "User database that can be updated and saved " name= "UserDatabase " type= "org.apache.catalina.UserDatabase "/>
<Resource auth= "Container " name= "jdbc/liuxue " type= "javax.sql.DataSource "/>
<ResourceParams name= "UserDatabase ">
<parameter>
<name> factory </name>
<value> org.apache.catalina.users.MemoryUserDatabaseFactory </value>
</parameter>
<parameter>
<name> pathname </name>
<value> conf/tomcat-users.xml </value>
</parameter>
</ResourceParams>
<ResourceParams name= "jdbc/liuxue ">
<parameter>
<name> factory </name>
<value> org.apache.commons.dbcp.BasicDataSourceFactory </value>
</parameter>
<parameter>
<name> url </name>
<value> jdbc:mysql://localhost:3306/liuxue?useUnicode=true&amp;characterEncoding=gb2312 </value>
</parameter>
<parameter>
<name> password </name>
<value> a </value>
</parameter>
<parameter>
<name> maxActive </name>
<value> 30 </value>
</parameter>
<parameter>
<name> maxWait </name>
<value> 10000 </value>
</parameter>
<parameter>
<name> driverClassName </name>
<value> com.mysql.jdbc.Driver </value>
</parameter>
<parameter>
<name> username </name>
<value> root </value>
</parameter>
<parameter>
<name> maxIdle </name>
<value> 10 </value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<Service name= "Catalina ">
<Connector acceptCount= "100 " connectionTimeout= "20000 " disableUploadTimeout= "true " port= "8080 " redirectPort= "8443 " maxSpareThreads= "75 " maxThreads= "150 " minSpareThreads= "25 ">
</Connector>
<Connector port= "8009 " protocol= "AJP/1.3 " protocolHandlerClassName= "org.apache.jk.server.JkCoyoteHandler " redirectPort= "8443 ">
</Connector>
<Engine defaultHost= "localhost " name= "Catalina ">
<Host appBase= "webapps " name= "localhost ">
<Logger className= "org.apache.catalina.logger.FileLogger " prefix= "localhost_log. " suffix= ".txt " timestamp= "true "/>