• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
reply
    Bookmark Topic Watch Topic
  • New Topic