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?