Wilson
Wilson

Reputation: 223

How to share connection pool among multiple Java applications

I'm implementing several JavaSE applications on single server. Is it possible to setup a single connection pool (e.g. C3P0) and share among these applications? I just want to have an easy way to manage the total number of DB connections.

Is there any drawbacks using such centralized connection pool?

Thank you, Wilson

Upvotes: 7

Views: 2445

Answers (1)

Fazal
Fazal

Reputation: 3051

You can simply use the same data source defined in the server for all application to share the same DB connection pool easily.

One obvious drawback would be that performance of independent application may degrade due to a load on totally unrelated application which would be hard to figure out.

Upvotes: 5

Related Questions