设置tomcat连接池了,先把tomcat目录下的 /tomcat/conf/server.xml 打开, 找到<Context>标签,在它下层加入下面代码
<Resource name="jdbc/test" url="jdbc:postgresql://localhost:5432/testdb"
username="happy"
password="world" auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" driverClassName="org.postgresql.Driver" /> 然后还有个问题就是要在你工程的发布配置文件web.xml注册 :
在<webapps>标签里 加入
|
在Tomcat 中配置PostgreSQL 连接池
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.