When you call close, the object should free all the resources that it uses behind the scenes. In the case of an instance, java.sql.Connectionthis will be one of two things:
- Release any physical database connection by freeing up resources. This happens when you open a database connection manually, for example.
DriverManager.getConnection(...). - SLEEPING , . ,
Connection DataSource, .
con = null null , , . Connection null close, .
close Closeable try-with-resources ( Java 7), , ) .