my dog learned polymorphism
The moose likes JDBC and Relational Databases and the fly likes Connection pooling without the server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Connection pooling without the server" Watch "Connection pooling without the server" New topic

Connection pooling without the server

Steve Wood
Ranch Hand

Joined: Jan 08, 2003
Posts: 137
Hi guys,

I've been reading (a little) about connection pooling and have a few questions.

If I don't know the configuration of the connection ahead of time (i.e. because the user can configure it as part of the application) - how can I set up a pool?

It seems that pools are really performant if you know the details and can configure the settings on the application server - therefore providing a pool. What do you do if the connection configuration is sorted out at run-time for the application? Are connection pools out of the question?

If so - are there any alternatives?

Any pointers would be gratefully received.

All the best,

Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3749

I think what you're asking is can you build a dynamic connection pool on the fly. I'd say it depends on what you are using for server software, but for the most part you can't. You could, alternatively, setup multiple connection pools to handle the different databases. This is way servers that change databases often require a restart, creating/deleting a connection pool affects everything on the server.

I would say think about why you need a dynamic connection pool more. The nature of connection pools is that they are psuedo-permanent, live on the server, and help minimize shared connections accross the server. Dynamic connections to databases are often limited in single use where having a connection pool would not help unless multiple people were using the same pool. But then the problem becomes what if you remove the pool while others are using it.

[OCA 8 Book] [Blog]
Steve Wood
Ranch Hand

Joined: Jan 08, 2003
Posts: 137
Thanks Scott,

That's the best answer I've heard to this question. The connections will need to be highly configurable and very few will be the same - it sounds like a connection pool is simply not an option.

All the best,

I agree. Here's the link:
subject: Connection pooling without the server
jQuery in Action, 3rd edition