code: protected void closeConnection() throws SQLException {
          if (connection != null && !connection.isClosed()) {
              connection.close();
              connection = null;
          }
  
      }
docs: Close the connection to the database.
  
  @throws SQLException
  if a database access error occurs