Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-2007

JDBC warnings are not properly handled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.7.1, 8.0
    • 7.7
    • JDBC Connector
    • None
    • Documentation (Ref Guide, User Guide, etc.), Release Notes

      Adding warnings individually results in redundant exceptions. See also TEIID-1829

      This is a behavior change though since the resulting warnings on the client side will be held by the cause. Proper access would be:

      //warning will be an instanceof TeiidSQLWarning to convey model/source information
      SQLWarning warning = stmt.getWarnings();

      while (warning != null) {
      Exception e = warning.getCause();
      if (cause instanceof SQLWarning) {
      //childWarning should now be the head of the source warning chain
      SQLWarning childWarning = (SQLWarning)cause;
      while (childWarning != null)

      { //do something with childWarning childWarning = childWarning.getNextWarning(); }

      }
      warning = warning.getNextWarning();
      }

              rhn-engineering-shawkins Steven Hawkins
              rhn-engineering-shawkins Steven Hawkins
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: