Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC connection pooling solutions?

 
Mike Blaszczak
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I'm working a project that implements a long-running stand-alone server with DropWizard and Java 8. We're using Oracle database in the back-end, and connect to it with JDBC.

I'm very confused about connection pooling. It seems like there's no connection pooling support built-in to JDBC. Is that correct? This JavaRanch article seems to confirm that JDBC doesn't do its own connection pooling implementation, but that article is more than eight years old. Has anything changed since?

I've found OracleConnectionPoolDataSource, but I can't find much documentation on how to use it. (What's the difference between a connection cache and a connection pool? What's the difference between an explicit cache and an implicit cache?)

I've found some posts on StackOverflow which say there's no JDBC pooling, but recommend other open-source libraries. This CodeRanch article does the same. However, those libraries don't seem to have much active development which makes me wary of using them.

What's the most stable approach?
 
Stefan Evans
Bartender
Posts: 1807
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are running in a container of some sort (e.g. Tomcat) and it provides connection pooling, I would go with that.

Otherwise I would go with the libraries you have had recommended to you in the Coderanch JDBC FAQ. No, they haven't had much active development lately, but they have had plenty of active USE.
I wouldn't have any qualms about using them. I would probably go with the apache one because of the less restrictive license, but that is very much project dependent.
 
Mike Blaszczak
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not running in a container. AS I mention, I'm executing a stand-alone server.

For the time being, I'm using Oracle's own Universal Connection Pool
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic