This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes question about DBCP example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "question about DBCP example" Watch "question about DBCP example" New topic
Author

question about DBCP example

John Robert
Ranch Hand

Joined: Jun 17, 2008
Posts: 39
Ranchers,

I am a little new to DBCP and trying to figure my way out. I was looking at the the following example code at DBCP Overview

In code, that might look like this:





I had trouble comprehending why the connectionFactory and poolableConnectionFactory (which uses the connectionFactory) initialized if its never used? Am I missing something here.
If all the datasource requires is connectionPool why cant we just create connectionPool and give it to the dataSource something like this


Am I missing something here?


And also is this implementation of the dataSource thread safe? can I have multiple threads call datasource.getConnection();


Any response would be appreciated

Thanks,



 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: question about DBCP example
 
It's not a secret anymore!