docs: private void checkIndex(int parameterIndex, boolean fetchingData) throws SQLException {
      if (!isFunction) {
        throw new PSQLException(
            GT.tr(
                "A CallableStatement was declared, but no call to registerOutParameter(1, <some type>) was made."),
            PSQLState.STATEMENT_NOT_ALLOWED_IN_FUNCTION_CALL);
      }
  
      if (fetchingData) {
        if (!returnTypeSet) {
          throw new PSQLException(GT.tr("No function outputs were registered."),
              PSQLState.OBJECT_NOT_IN_STATE);
        }
  
        if (callResult == null) {
          throw new PSQLException(
              GT.tr("Results cannot be retrieved from a CallableStatement before it is executed."),
              PSQLState.NO_DATA);
        }
  
        lastIndex = parameterIndex;
      }
    }