close()

Syntax:

void close() throws SQLException

Description:

Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.

Calling the method close on a Connection object that is already closed is a no-op.

It is strongly recommended that an application explicitly commits or rolls back an active transaction prior to calling the close method. If the close method is called and there is an active transaction, the active transaction is aborted.

Throws:

SQLException - if a database access error occurs

Reference:

For more information, reference JDBC documentation for: Connection.close()