• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Connection Pooling

 
Erik Ekote
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic