look you can access the database by entering this code in struts-config.xml
below is the code to enter
<data-sources>
<data-source
type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName"
value="com.mysql.jdbc.Driver" />
<set-property property="url"
value="jdbc:mysql://localhost/retail" />
<set-property property="username"
value="root" />
<set-property property="password"
value="root" />
</data-source>
</data-sources>
in the place of driverclassName put your jdbc
dbc bridge and on the url place put the database name with the required things.
and now in the action class you can use this.
DataSource dataSource=getDataSource(HttpServletRequest);
Connection con=dataSource.getConnection() and now the rest things are as usual...