Connection

I want to create connection at init,Every time i have to use the connection, but i should not close physically,using con.close(),every time i have to close logically, how i can close
[203 byte] By [vaidyabhuvan] at [2007-9-26 1:47:38]
# 1
Can you tell us one of your well kept secrets ? What sort of connection is it ?
neville_sequeira at 2007-6-29 2:46:56 > top of Java-index,Archived Forums,Java Programming...
# 2
This is simply Database connection, using JDBCODBC Driver,how we can close logically,
vaidyabhuvan at 2007-6-29 2:46:56 > top of Java-index,Archived Forums,Java Programming...
# 3

Don't understand your "physically" and "logically".

I assume you want to use a connection as long as you need it, and close then. (One would not call it a logical connection, if you do only a db access over an existing connection.)

Just do:

Connection con = ... // Connect

at the beginning,

use this con for each kind of SQL statements,

and after the last of them, at the end of your db work - if you want: just before System.exit() - do:

con.close();

Clear?

Hartmut at 2007-6-29 2:46:56 > top of Java-index,Archived Forums,Java Programming...