当前位置:Gxlcms > 数据库问题 > 数据库连接池配置

数据库连接池配置

时间:2021-07-01 10:21:17 帮助过:50人阅读

/POS" docBase="POS" debug="5" reloadable="true" crossContext="true" workDir=""> <Resource name="jdbc/pos" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="root" password="1234" driverClassName="org.gjt.mm.mysql.Driver" url="jdbc:mysql://localhost/test" /> </Context>

 

3 在tomcat的安装目录下webapps文件夹中新建一个名为POS的文件夹。

 

4 在POS文件夹下新建目录WEB-INF,并在WEB-INF下新建文件夹classes,并且添加web.xml。配置如下:

    

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
    
    
    <resource-ref>
        <description>DB Connection</description>
        <res-ref-name>jdbc/pos</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
    
    <welcome-file-list>
        <welcome-file>
            login.jsp
        </welcome-file>
    </welcome-file-list>
    
</web-app>

 

配置完成

数据库连接池配置

标签:-name   code   子目录   password   5.x   org   连接池   server   oss   

人气教程排行