code: public int getTransactionIsolation() throws SQLException {
      Statement stmt = createStatement();
      String sql = "SELECT @@tx_isolation";
  
      if (!protocol.isServerMariaDb()) {
        if ((protocol.getMajorServerVersion() >= 8 && protocol.versionGreaterOrEqual(8, 0, 3))
            || (protocol.getMajorServerVersion() < 8 && protocol.versionGreaterOrEqual(5, 7, 20))) {
          sql = "SELECT @@transaction_isolation";
        }
      }
  
      ResultSet rs = stmt.executeQuery(sql);
      if (rs.next()) {
        final String response = rs.getString(1);
        switch (response) {
          case "REPEATABLE-READ":
            return Connection.TRANSACTION_REPEATABLE_READ;
  
          case "READ-UNCOMMITTED":
            return Connection.TRANSACTION_READ_UNCOMMITTED;
  
          case "READ-COMMITTED":
            return Connection.TRANSACTION_READ_COMMITTED;
  
          case "SERIALIZABLE":
            return Connection.TRANSACTION_SERIALIZABLE;
  
          default:
            throw ExceptionMapper.getSqlException("Could not get transaction isolation level: "
                + "Invalid value \"" + response + "\"");
        }
      }
      throw ExceptionMapper.getSqlException("Could not get transaction isolation level");
    }
docs: Retrieves this <code>Connection</code> object's current transaction isolation level.
  
  @return the current transaction isolation level, which will be one of the following constants:
  <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
  <code>Connection.TRANSACTION_READ_COMMITTED</code>, <code>Connection.TRANSACTION_REPEATABLE_READ</code>,
  <code>Connection.TRANSACTION_SERIALIZABLE</code>, or <code>Connection.TRANSACTION_NONE</code>.
  @throws SQLException if a database access error occurs or this method is called on a closed
  connection
  @see #setTransactionIsolation