JDBC 4.2 default methods java.sql.PreparedStatement.setObject should delegate

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P5
    • None
    • Affects Version/s: 8u66
    • Component/s: core-libs
    • x86
    • windows_8

      FULL PRODUCT VERSION :
      java version "1.8.0_66"
      Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      In JDBC 4.2 new default methods were added to the PreparedStatement interface:

      default void setObject(int parameterIndex, Object x, SQLType targetSqlType)
            throws SQLException {
              throw new SQLFeatureNotSupportedException("setObject not implemented");
          }

      Surely it should delegate to the old setObject method as follows:

      default void setObject(int parameterIndex, Object x, SQLType targetSqlType)
            throws SQLException {
              setObject(parameterIndex,x,targetSqlType.getVendorTypeNumber());
          }


      With the current implementation there is no point invoking the new method EVER, as there is always a chance that you will change driver to something that doesn't implement it.


      REPRODUCIBILITY :
      This bug can be reproduced always.

            Assignee:
            Lance Andersen
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: