| Author |
JDBC Connection Pooling
|
Erik Ekote
Greenhorn
Joined: Mar 07, 2005
Posts: 1
|
|
Hello, I want to access a db using properties object(connection pooling I think). Is there any one here who could give me an example how to do this? The reason why I want to do this is because the JDBC code should not be tempered with any time some one comes new. One just have to change the logon properties (basically the userid and pwd)in an external file.Below is the code.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26155
|
|
Erik, Welcome to JavaRanch! You can create a Properties file by calling its load() method. Then you can use the getters to get the individual properties instead of hardcoding them in the connection request. Note that this is not connection pooling. Connection pooling gets a connection from a datasource on an application server (or other pool.) Also, I don't see where you close the resultset.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: JDBC Connection Pooling
|
|
|