It's not a secret anymore!*
The moose likes Struts and the fly likes Accessing data source inside Action servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Accessing data source inside Action servlet" Watch "Accessing data source inside Action servlet" New topic
Author

Accessing data source inside Action servlet

Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
Ok I've extended the ActionServlet for a web app so I could initialize values in the servletContext from the database. How can I access the datasources that are set up in the struts-config?
I've found a method which seems to be depracated (and didn't work): getDataSource(String name);
and then I found a member called dataSources which is a "fastHashMap"
And I'm not quite sure how to get the dataSource from it. I'm only using one data source so its not "keyed".


-Tad
 
wood burning stoves
 
subject: Accessing data source inside Action servlet