public boolean closeConnection() throws SQLException {
  if (connection == null) {
    return false;
  }
  connection.close();
  connection=null;
  return true;
}

public boolean closeConnection ( ) throws SQLException { if ( connection == null ) { return false ; } connection . close ( ) ; connection = null ; return true ; }
closes the connection with the database
