求MySql利用Tomcat实现数据库连接池的数据源配置文件?

2025年03月24日 10:58
有1个网友回答
网友(1):

server.xml中的配置

driverClassName="com.mysql.jdbc.Driver" maxActive="10"
maxIdle="10" maxWait="-1"
name="jdbc/ifcp" password="123"
type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/XXX?charactorEncoding=utf8"
username="root"
removeAbondoned="true"
/>

其中XXX是你的项目路径
web.xml好像不用特别的配置吧。如果需要可以加入下面的

Mysql Datasource example
jdbc/ifcp
javax.sql.DataSource
Container
Unshareable