DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25827>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25827

how to access data source when managing DB in a servlet?

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX



------- Additional Comments From [EMAIL PROTECTED]  2003-12-30 23:42 -------
You'd continue to "cheat" using whatever name you provided the datasource
implementation. The DATA_SOURCE_KEY is the default name for the attribute, but
any name can be used. 

However, if its just the Struts config that initializing the datasource, then
there is no clean way to access it without access to a servlet request. You
could do something like use a PlugIn to register it with a singleton class, but
that gets rather messy. 

If you want to use the datasource outside of an Action, then the best thing
really is to use some other mechanism to bootstrap the datasource and just leave
Struts out of it. 

As mentioned, we're discouraging use of the Struts datasource manager in favor
of more mainstream solutions, like JNDI managed through the container.

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to