It's not a secret anymore!
The moose likes JDBC and the fly likes JDBC Connection Pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "JDBC Connection Pooling" Watch "JDBC Connection Pooling" New topic
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
    
  66

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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: JDBC Connection Pooling
 
Similar Threads
Problem in Seperating Core Servlet to Database Query Java
error #704....uhg!
How to get the number of rows in a ResultSet
Applet to Database connection
SQL query takes too long to execute?