File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to access Datasource Tag (struts-config.xml)  in POJO" Watch "How to access Datasource Tag (struts-config.xml)  in POJO" New topic

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

Neha k Agrawal

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

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:
subject: How to access Datasource Tag (struts-config.xml) in POJO
It's not a secret anymore!