Chris,

Thanks for the reply - this sounds like just what I need.

> For instance, Apache Tomcat makes this pretty darned easy. 
> You can define a JNDI datasource at the server level, or per 
> webapp. The configuration is (roughly) the same; it just goes 
> in a different place in your config files.

I'm using Tomcat 5.5.x.  The documentation for this looks pretty good, now
that I know where to look for it.  Thanks!


> I never use data sources in action code. I find this to be a 
> bad practice, since I tend to think of my actions as being in 
> the display logic layer, not in my data access layer.
> 
> My data access layer is made up of a series of service 
> classes which all inherit from a base class which defines a 
> getConnection method which roughly does the above (and 
> properly checks for null, NamingExceptions, etc.).

This sounds very similar to what I have.  The main difference seems to be
that I pass the DataSource in from the action layer, instead of allocating
it here.


> Whatever do you, I would recommend against putting any 
> JNDI-specific code into (all) your actions. If you have to 
> keep data access in your actions, I would recommend putting a 
> getConnection method in your actions' base class and then use 
> that instead of Action.getDataSource().

This is what I'm doing currently, although it would probably be worthwhile
moving it down into the class mentioned above, as you suggest.

Thanks again!

Daniel



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

Reply via email to