code: public void commit() throws SQLException {
      lock.lock();
      try {
        if (protocol.inTransaction()) {
          try (Statement st = createStatement()) {
            st.execute("COMMIT");
          }
        }
      } finally {
        lock.unlock();
      }
    }
docs: Sends commit to the server.
  
  @throws SQLException if there is an error commiting.