Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Not A Problem
-
1.3.8
-
None
-
None
-
windows xp, tomcat 6.0.16 , struts 1.3.8
-
Important
Description
Hi i am using struts 1.3.8 & tomcat 6.0.16. I want to use <data-sources> tag in my application to access database can you help me to configure data-source & how to access data source in application
<data-sources>
<data-source type="org.apache.commons.dpcp.BasicDataSource" key="empTable">
<set-property property="password" value="pramod@123" />
<set-property property="minCount" value="1" />
<set-property property="maxCount" value="10" />
<set-property property="user" value="sa" />
<set-property property="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<set-property property="description" value="CRM database" />
<set-property property="url" value="jdbc:sqlserver://192.168.37.87" />
<set-property property="readOnly" value="false" />
<set-property property="autoCommit" value="true" />
<set-property property="loginTimeout" value="" />
</data-source>
</data-sources>
<action path="/try" name="Test" type="com.myapp.struts.OwnerAction">
<forward name="success" path="/Success.jsp"/>
</action>
//DataSource dataSource = (DataSource)servlet.getServletContext().getAttribute("org.apache.struts.action.DATA_SOURCE");
DataSource dataSource = (DataSource)servlet.getServletContext().getAttribute("empTable");
dataSource is null.............................