Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6318

Simplify setting of possibly null parameters in XPLAIN descriptors

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 10.11.1.1
    • 10.11.1.1
    • SQL
    • None
    • Low

    Description

      I noticed that the various XPLAIN descriptor classes need to set lots of numeric parameters on a PreparedStatement, using the following idiom to allow null values:

      if (parse_time != null)
      ps.setLong(2, parse_time.longValue());
      else
      ps.setNull(2, Types.BIGINT);

      The same thing could have been achieved by using a single call to setObject(), like this:

      ps.setObject(2, parse_time, Types.BIGINT);

      This would make the methods shorter and clearer.

      Attachments

        1. d6318-1a.diff
          12 kB
          Knut Anders Hatlen

        Activity

          People

            knutanders Knut Anders Hatlen
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: