code: private void readPacket(Results results) throws SQLException {
      Buffer buffer;
      try {
        buffer = reader.getPacket(true);
      } catch (IOException e) {
        throw handleIoException(e);
      }
  
      switch (buffer.getByteAt(0)) {
  
        //*********************************************************************************************************
        //* OK response
        //*********************************************************************************************************
        case OK:
          readOkPacket(buffer, results);
          break;
  
        //*********************************************************************************************************
        //* ERROR response
        //*********************************************************************************************************
        case ERROR:
          throw readErrorPacket(buffer, results);
  
          //*********************************************************************************************************
          //* LOCAL INFILE response
          //*********************************************************************************************************
        case LOCAL_INFILE:
          readLocalInfilePacket(buffer, results);
          break;
  
        //*********************************************************************************************************
        //* ResultSet
        //*********************************************************************************************************
        default:
          readResultSet(buffer, results);
          break;
  
      }
  
    }
docs: Read server response packet.
  
  @param results result object
  @throws SQLException if sub-result connection fail
  @see <a href="https://mariadb.com/kb/en/mariadb/4-server-response-packets/">server response
  packets</a>