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

executing getXXX() for a column checks the column position is in range three times, reduce to one.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • JDBC, SQL
    • Low
    • Performance

    Description

      On a getXXX() method the column position is checked in:

      Once in EmbedResultSet.getColumn()

      Twice in ValueRow.getColumn()

      • once using explict code
      • once implicitly when accessing the DataValueDescriptor array

      Can reduce to once by solely relying on the array bounds checking. Then change the defined api to Row.getColumn to state that it throws IndexOutOfBoundsException for an invalid column. EmbedResultSet.getColumn() then can catch that exception and throw the required SQLException.

      Probably need similar changes on the setXXX() methods and other getXXX methods and need to see how Row.getColumn() is used within the language layer.

      Attachments

        1. d2139_getXXX_draft.txt
          3 kB
          Daniel John Debrunner

        Issue Links

          Activity

            People

              Unassigned Unassigned
              djd Daniel John Debrunner
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: