Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Connection Pooling in J2SE 1.4.2

Status
Not open for further replies.

microserf

Programmer
Oct 18, 2005
12
0
0
GB
Hi all

If I am using J2SE 1.4.2, a mysql DB (connecting using com.mysql.jdbc.Driver) and if I get a DB connection using DriverManager.getConnection(), are my DB connections pooled? (I.e. if I call close() on a connection object, is the connection actually closed, or just returned to a pool of open connections?)

If connections are not automatically pooled, what is the best way to obtain connection pooling such that when I call close() on a Connection, the connection is returned to the pool?

Thanks.
 
If I am using J2SE 1.4.2, a mysql DB (connecting using com.mysql.jdbc.Driver) and if I get a DB connection using DriverManager.getConnection(), are my DB connections pooled? (I.e. if I call close() on a connection object, is the connection actually closed, or just returned to a pool of open connections?)

No, the connections are not pooled. When you close the connection, it is physically closed against the database.

If connections are not automatically pooled, what is the best way to obtain connection pooling such that when I call close() on a Connection, the connection is returned to the pool?

You will need to use some 3rd party connection pooling system. There is a list of open source pools here :
Some are better than others :p

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I think I've heard about primrose in some place ...

Cheers,
Dian
 
Thanks sedj,

Do you have any recommendations as to which connection pooling library I should choose? My requirements are that I should have to make minimal changes to my code (I don't need the very best performance, I just need to reuse connections).

Thanks
 
lol, well my recommendation might be a little bit biased considering I wrote Primrose :)


--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
... ah, I wondered what Dian was going on about...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top