struts连接池配置
struts连接池配置,只写了两个例子,实际开发中最好不用struts带的连接池,不利于系统程序换移植!
SQLServer2000数据库连接池配置如下:
<data-sources>
<data-source key="org.apache.struts.action.DATA_SOURCE" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
<set-property property="url" value="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=jdsdb" />
<set-property property="username" value="sa" />
<set-property property="password" value="" />
<set-property property="maxActive" value="200" />
<set-property property="maxIdel" value="30" />
<set-property property="maxWait" value="10000" />
<set-property property="autoReconnect" value="true" />
<set-property property="max-connections" value="10" />
<set-property property="min-connections" value="2" />
<set-property property="inactivity-timeout" value="30" />
<set-property property="wait-timeout" value="30" />
<set-property property="eroDateTimeBehavior" value="convertToNull" />
</data-source>
</data-sources>
MySQL数据库连接池配置如下:
<data-sources>
<data-source key="org.apache.struts.action.DATA_SOURCE" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="com.mysql.jdbc.Driver" />
<set-property property="url" value="jdbc:mysql://127.0.0.1:3306/JDSDB?useUnicode=true&characterEncoding=gb2312" />
<set-property property="username" value="root" />
<set-property property="password" value="" />
<set-property property="maxActive" value="200" />
<set-property property="maxIdel" value="30" />
<set-property property="maxWait" value="10000" />
<set-property property="autoReconnect" value="true" />
<set-property property="max-connections" value="10" />
<set-property property="min-connections" value="2" />
<set-property property="inactivity-timeout" value="30" />
<set-property property="wait-timeout" value="30" />
<set-property property="eroDateTimeBehavior" value="convertToNull" />
</data-source>
</data-sources>
struts连接池配置,只写了两个例子,实际开发中最好不用struts带的连接池,不利于系统程序换移植!
SQLServer2000数据库连接池配置如下:
<data-sources>
<data-source key="org.apache.struts.action.DATA_SOURCE" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
<set-property property="url" value="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=jdsdb" />
<set-property property="username" value="sa" />
<set-property property="password" value="" />
<set-property property="maxActive" value="200" />
<set-property property="maxIdel" value="30" />
<set-property property="maxWait" value="10000" />
<set-property property="autoReconnect" value="true" />
<set-property property="max-connections" value="10" />
<set-property property="min-connections" value="2" />
<set-property property="inactivity-timeout" value="30" />
<set-property property="wait-timeout" value="30" />
<set-property property="eroDateTimeBehavior" value="convertToNull" />
</data-source>
</data-sources>
MySQL数据库连接池配置如下:
<data-sources>
<data-source key="org.apache.struts.action.DATA_SOURCE" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="com.mysql.jdbc.Driver" />
<set-property property="url" value="jdbc:mysql://127.0.0.1:3306/JDSDB?useUnicode=true&characterEncoding=gb2312" />
<set-property property="username" value="root" />
<set-property property="password" value="" />
<set-property property="maxActive" value="200" />
<set-property property="maxIdel" value="30" />
<set-property property="maxWait" value="10000" />
<set-property property="autoReconnect" value="true" />
<set-property property="max-connections" value="10" />
<set-property property="min-connections" value="2" />
<set-property property="inactivity-timeout" value="30" />
<set-property property="wait-timeout" value="30" />
<set-property property="eroDateTimeBehavior" value="convertToNull" />
</data-source>
</data-sources>