Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-639

JDBCInterpreter should check for null

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.6.0
    • 0.6.0
    • Interpreters

    Description

      JDBCInterpreter.java should check for a null return on resultSet column instead of simply calling getString. Some incomplete, or poorly implemented JDBC drivers may not check for you. I've observed this behavior in the sqlline project.

      Fix could be something like:

                while (resultSet.next() && displayRowCount < getMaxResult()) {
                  for (int i = 1; i < md.getColumnCount() + 1; i++) {
                    o = resultSet.getObject(i);
                    if (o == null) {
                      v = "null";
                    } else {
                      v = o.toString();
                    }
      
                    msg.append(replaceReservedChars(isTableType, v));
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            cmatta Chris Matta
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: