You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Scott Purcell <sp...@vertisinc.com> on 2005/04/14 23:16:17 UTC
DBCP Anyone?
Hello,
I have created a simple BasicDataSource object, and have a couple of questions.
I want to write a class that I can call that hides the ResultSet. So I want to create a class that has some helper methods like so:
String val = Class.getString("Select name from somewhere");
And my Class, would call the BasicDataSource for a connection.
So upon modeling this, I realized that I should probably be putting the BasicDataSource connection into a singleton? I started thinking that if I keep instantiating a class that creates BasicDataSource objects, that I will probably be creating new pools of connections and not using the existing set of pooled connections. Is this correct?
Also, after creating the BasicDataSource, I am passing in username, drivers, etc. with methods:
ds.setDriverClassName("oracle.bla.");
ds.setUsername(etc);
The docs say I can use a properties file, and I would like to do that, but I do not know how to attempt this. Can someone please, help
Thanks,
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org