The act of creating a new Connection to the database can take a significant length of time and so you would not want to do this every time that you execute a SQL statement. Ideally
you should be using a pool of database connections that is managed by a javax.sql.DataSource resource. If you close a connection that is managed by the DataSource you are just returning it to the pool of available connections (i.e. it is not actually disconnected from the DB).
If you use the DataSource then you should get into the habit of writing getConnection() - use - close() code withing try {} catch() finally {} blocks to ensure that all of the DB resources are released even if an error occurs.
Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams