aspose file tools*
The moose likes JDBC and the fly likes How to access Datasource Tag (struts-config.xml)  in POJO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to access Datasource Tag (struts-config.xml)  in POJO" Watch "How to access Datasource Tag (struts-config.xml)  in POJO" New topic
Author

How to access Datasource Tag (struts-config.xml) in POJO

Neha k Agrawal
Greenhorn

Joined: Mar 25, 2008
Posts: 25
Hello friends,
I am doing a project in struts.I have stored the database connection information in data-source tag of struts-config.xml file.This is the code.



Now I want to access this data in POJO.I know how to use it in action class but unable to use it in POJO.To access it in action class , the code goes like this....



Can anyone tell me what to do?.Any help will be highly appreciated.Thank you in advance.
Praveen Sangolli
Greenhorn

Joined: May 22, 2008
Posts: 28
Hi Neha,

I am not sure whether this might help you, it sounds silly...
Have you tried sending DataSource as a parameter to a method in your POJO.
By doing so you will have a handle to the datasourse and then you can get hold of the connection object..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to access Datasource Tag (struts-config.xml) in POJO