Tomcat下配置Mysql的连接池

1.在$CATALINA_HOME/conf/server.xml中添加配置信息,声明连接池的具体信息,添加内容如下:
  

  
  
引用:
factory
  
  org.apache.commons.dbcp.BasicDataSourceFactory
  

  
  
  maxWait
  
  5000
  

  
  maxActive
  
  20
  
  

  
  username
  
  shopadm
  

  
  
  password
  
  123

  
  
  url
  
  jdbc:mysql://localhost/shopdb?useUnicode=true&charact-erEncoding=gb2312
  

  
  driverClassName
  
  com.mysql.jdbc.Driver
  

  
  maxIdle
  
  10