db connection open

Hi,normally we keep the database open always. why ?why we are not opening the db whenever we want to insert the data or retrieve the data from the db?what is the basic reason behind this?
[215 byte] By [padikkathavana] at [2007-11-27 6:47:50]
# 1
performance
tschodta at 2007-7-12 18:20:54 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
thankscan you pls. explain a little bit further?...
padikkathavana at 2007-7-12 18:20:54 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
> thanks> > can you pls. explain a little bit further?...You asked why. Performance.What specifically did you not understand about that answer?
cotton.ma at 2007-7-12 18:20:54 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
Sorry. don't mistake.I am new to java.what I mean is, how performance is increased by the keeping the db open always ?thanks...
padikkathavana at 2007-7-12 18:20:54 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

> Sorry. don't mistake.

>

> I am new to java.

>

> what I mean is, how performance is increased by the

> keeping the db open always ?

>

> thanks...

Ah. How.

Well there is a certain amount of overhead associated with creating and destroying the sockets that often underlie database connections. There is also some overhead to do with steps like user authentication from the database side of things.

All of this overhead is a non-issue when you re-use connections through a connection pool.

cotton.ma at 2007-7-12 18:20:54 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...