Spring Framework
  1. Spring Framework
  2. SPR-10385

JdbcTemplate cannot set null parameter with Oracle driver

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 3.2.2
    • Fix Version/s: 3.2.3, 4.0 M1
    • Component/s: None
    • Labels:
    • Last commented by a User:
      true

      Description

      The StatementCreatorUtils.setNull(..) method fails with an Oracle database.

      The method expects the driver to throw an exception when ps.getParameterMetaData() is invoked (line 234), but this actually succeeds and returns a value.

      Later in the method (line 241), when pmd.getParameterType() is invoked, Oracle throws an "Unsupported Feature" exception.

      I think the easiest fix here would be to move the getParameterType() invocation into the existing try block so both conditions are accounted for.

      Stack trace attached.

      1. StackTrace.txt
        3 kB
        Tom Witmer
      2. StatementCreatorUtils.java
        18 kB
        Tom Witmer
      3. StatementCreatorUtils-ProposedFix
        18 kB
        Tom Witmer

        Issue Links

          Activity

          Hide
          Tom Witmer added a comment -

          Source file attached, in case the line numbers don't match up to trunk source.

          Show
          Tom Witmer added a comment - Source file attached, in case the line numbers don't match up to trunk source.
          Hide
          Tom Witmer added a comment -

          Attached source file that should resolve the issue.

          Show
          Tom Witmer added a comment - Attached source file that should resolve the issue.
          Hide
          Tom Witmer added a comment -

          I just confirmed via the debugger that the proposed fix (attachment) would resolve the problem I'm seeing.

          Show
          Tom Witmer added a comment - I just confirmed via the debugger that the proposed fix (attachment) would resolve the problem I'm seeing.

            People

            • Assignee:
              Juergen Hoeller
              Reporter:
              Tom Witmer
              Last updater:
              Juergen Hoeller
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 5 weeks, 5 days ago