Am Montag, 12. Januar 2004 17:32 schrieb [EMAIL PROTECTED]:
> What is the best practice for establishing a data source connection
> using JNDI.
> I am using the DAO pattern for database access but where is the best
> location for placing the code that initializes the data source?
> I am using connection pooling.
> I am moving a Struts application into a Portlet.
> The core servlet is com.ibm.wps.portlets.struts.WpsStrutsPortlet.
For global initialization, we usually use a 'resource' listener
(a simple class with 2 methods implementing ServletContextListener)
that fires up all the Singletons and initializes the DAO and
SessionFacade, among other things. Another approach would be
to use static initializers (static {...;}). For details about the latter
approach, check out the excellent manual for iBATIS (www.ibatis.com),
an open source OR mapping solution you might want to adapt
your DAO to as well.
> Thanks
HTH,
-- Chris.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]