You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Antonio Petrelli (JIRA)" <ji...@apache.org> on 2008/07/21 13:11:06 UTC

[jira] Closed: (STR-3158) Hi i am using struts 1.3.8 & tomcat 6.0.16. I want to use tag in my application to access database can you help me to configure data-source & how to access data source in application

     [ https://issues.apache.org/struts/browse/STR-3158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli closed STR-3158.
---------------------------------

    Resolution: Not A Problem

Please do not use JIRA to ask question.
Please write to the Struts Users mailing list:
http://struts.apache.org/mail.html

> 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
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: STR-3158
>                 URL: https://issues.apache.org/struts/browse/STR-3158
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Example Applications
>    Affects Versions: 1.3.8
>         Environment: windows xp, tomcat 6.0.16 , struts 1.3.8
>            Reporter: pramodk
>            Priority: Critical
>
> 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.............................

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.