Eric P wrote:
> Hi,
>
> (Tomcat newb alert)
>
> I've got a simple database servlet application that has a few model
> classes on the back end.
>
> I have the model classes pretty well genericized so that they could
> (almost) be utilized outside of Tomcat by another app, but they do
> utilize the Tomcat data sources I've set up (via an InitialContext
> data source lookup).  So this makes it impossible (?) to execute the
> model classes outside of Tomcat.
>
> Does anyone have any suggestions about how they would approach this
> problem so that they could debug and/or utilize these model classes
> that rely on database access?
>
> Thanks for reading.  I'm open to any/all ideas.
> Eric P.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>

I'll bet the only thing your code does with a JNDI string is perform the
lookup and get a Datasource.  You could implement multiple constructors
allowing your code to be initialized w/ a JNDI string, DataSource
object, or url/username/password.  The code utilizing the model classes
would simply create them using which ever constructor it has data for.

--David


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to