I don't have a slick trick, but what I do is get my datasources from a dbhelper class. In that class I try to read from jndi, if I can't get access to jndi I read from a config file that sits on the classpath. In Tomcat it gets the connection from jndi, for tests i create it from the config file. Of course you can use a filesystem jndi implementation that does the same thing (so I've read), but I guess I took the easy way out. Wish I had some slick way of doing this.

Matt



WHIRLYCOTT wrote:

I'm wondering if somone has any creative ideas here. I'm working on a project that gets javax.sql.DataSource instances via Tomcat's JNDI provider. This works fine, except when we are developing code and need to run Junit tests.

Because the tests need to run outside Tomcat, getting access to a DataSource via JNDI becomes a pain in the neck.

I'm assuming that this is a very common situation and I'm wondering if anybody has slick tricks for your dev environments that allow you do get DataSource objects via JNDI...?

phil.


-- Matt Goodwin [EMAIL PROTECTED] (515)708-0114 Metalexis "Transcending the Ordinary"


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



Reply via email to