I have been using sturts 1.1 all the time. Now I have used Versions later than 1.2 to find different methods for configuring the connection pool.
1.1 Configuration
<Data-source key = "oracledb1" type = "org. Apache. Struts. util. genericdatasource">
<Set-Property = "driverclass"
Value = "oracle. JDBC. Driver. oracledriver"/>
<Set-Property = "url"
Value = "JDBC: oracle: thin: @ localhost: 1521: ora9i"/>
<Set-Property = "maxcount" value = "5"/>
<Set-Property = "mincount" value = "1"/>
<Set-Property = "user" value = "test"/>
<Set-Property = "password" value = "admin"/>
<Set-Property = "autocommit" value = "true"/>
</Data-source>
This is strutsA built-in database connection pool.
Then enterPropertyOfValue.
Test, easy to use.
IfTypeSelect:
Org. Apache. commons. DBCP. basicdatasource
ThisDBCPDatabase Connection Pool.
Enter the correctValue.
Test, prompting various exceptions&Not foundDriver.
ViewDBCPDocumentation, foundMyeclipseGenerated ConfigurationXMLElement error.
DBCPYesDriverclassnameAndUsernameThe twoPropertys.
WhileMyeclipseAutomatically generated isDriverclassAndUserThe twoPropertys.
After modification, we found thatDBCPThe database connection pool is also used :)
This requires downloading three packages of commons-dbcp-1.2.2.jar commons-pool-1.4.jar commons-collections-3.2.1.jar on the Apache website.
<Data-source key = "DB2" type = "org. Apache. commons. DBCP. basicdatasource">
<Set-Property = "driverclassname"
Value = "com. IBM. db2.jcc. db2driver"/>
<Set-Property = "url"
Value = "JDBC: DB2: // localhost: 50000/Goodluck"/>
<Set-Property = "maxcount" value = "5"/>
<Set-Property = "mincount" value = "1"/>
<Set-Property = "username" value = "db2inst1"/>
<Set-Property = "password" value = "db2inst1"/>
<Set-Property = "autocommit" value = "true"/>
</Data-source>