jsp怎么使用mysql数据库连接池

1392
2021/2/14 15:42:09
栏目: 云计算
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

jsp怎么使用mysql数据库连接池

jsp使用mysql数据库连接池的方法

1.在conf目录中打开context.xml文件,并在文件写如下代码;

name = "jdbc/ConnectionPool"

auth = "Container"

type = "javax.sql.DataSource"

password = "123456"

driverClassName = "com.mysql.jdbc.Driver"

maxIdle = "2"

maxWait = "5000"

username = "root"

url = "jdbc:mysql://localhost:3306/study?characterEncoding=GBK"

maxActive = "4"/>

Web-INF/web.xml

2.然后打开web.xml文件,在文件写入代码;

GuestBook

jdbc/ConnectionPool

javax.sql.DataSource

Container

辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读: mysql拆分函数怎么使用