
Signature
--
~kaeli~
When two egotists meet, it's an I for an I.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
> Is there a way to use a datasource to connect to a DB besides using JNDI?
> Right now, my connection string is hard-coded and it's a minor pain to change
> between the production and test databases. I'd prefer to have it in a config
> file somehow, but JNDI seems like way more than I need for a small
> application.
> Any hints?
Just instantiate the datasource (it must have a no-args ctor), set the connection
properties and call getConnection(). For example:
javax.sql.DataSource ds = new com.vendor.DataSource();
ds.setServerName("godzilla");
ds.setPortNumber(9999);
java.sql.Connection connection = ds.getConnection("kaeli", "tiger");
You'll need to check the vendor docs or use reflection/inspection to find out the
connection properties.

Signature
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)