Here is an example code fragment that shows how to close a database connection:
If (c != null)
{
try
c.commit();
c.close();
}
catch (SQLException e)
System.err.println("Close connection failed, " + e);