When ur working with struts-DBCP procedure follow 1.in the struts-config.xml file u have to write type="org.apache.commans.dbcp.BasicDataSource" package we have to import
2.After that u have to configure properties driverclassname= url= username= password=
copy commans.dbcp.jar file and commans.pool12.jar file in the lib directory of the web application set classpath.
3.after that in the struts-config.xml file u have to write like this <struts-config> <data-sources> <data-source key="orakey like that " type="" <property name="username" value="scott"> <property name="password" value="tiger">
4.Get the data source object in action class by public datasource getDataSource(HttpServletRequest,ActionMapping)
5. import javax.sql.datasource public connection getConnection() public connection getConnection(String username,String password)
View All Comments
| View Tutorial