wood burning stoves*
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
jQuery in Action, 2nd edition
 
subject: Accessing data source inside Action servlet
 
Similar Threads
dynamically lookup datasources from stateless sessin bean
Loading application scope variables on startup.
JasperReports and databases
How to make a data source connection without writing a User name & Password and the -ds.xml file
Readin struts-config.xml from Action