
Hi i need to know how to do set up of Oracle data base with struts using Data source.I have defined datasource in struts-config.xml as
data-sources>
<data-source type="oracle.jdbc.pool.OracleConnectionPoolDataSource">
<set-property property="URL"
value="jdbc:oracle:thin:@192.168.11.106:1521:server"/>
<set-property property="user" value="SCOTT"/>
<set-property property="password" value="TIGER"/>
</data-source>
</data-sources>
Then in my action class i am retrieving as
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
System.out.println("In Action of accept");
String agregno = request.getParameter("agregno");
System.out.println(agregno);
boolean valid = Validation.acceptAgent(agregno, getDataSource(request));
System.out.println("After val");
System.out.println(valid);
if (valid) {
return mapping.findForward("success");
}
return mapping.findForward("fail");
}
I am getting error like getDatasource method does not exist.