java.sql.SQLFeatureNotSupportedException: Unsupported feature

Spring JIRA | Tom Jahncke | 1 year ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    This relates to: https://jira.spring.io/browse/SPR-11100 Using the oracle driver (ojdbc7 version 12.1.0.2.0) I ran across the following issue (I opened a support case with Oracle on the root cause of the issue. SR 3-11927085951) Normally the Oracle driver works fine with following code: {code} sqlTypeToUse = ps.getParameterMetaData().getParameterType(paramIndex); (from setNull in StatementCreatorUtils line 262) {code} However, it is possible for a statement to cause Oracle to throw an exception than then all statements going forward no longer use the JDBC 3.0 features to resolve the sql data type for null values. I understand why driversWithNoSupportForGetParameterType exists and how it helps performance. However, since it is black or white once an exception is thrown the setNull never tries to use the JDBC 3.0 features again (until the app is restarted). I can think of a few hackish ways to address this, but I am hoping you can come with a solid solution that is solid (My hackish ideas are along the lines or allowing a driver name to be injected that doesn't get added to the global set of drivers not supported.) FYI, just by having an insert statement with a qualified table name causes the following exception with the oracle JDBC driver. (Without qualification no exception.): {code} java.sql.SQLFeatureNotSupportedException: Unsupported feature at oracle.jdbc.driver.OracleParameterMetaData.checkValidIndex(OracleParameterMetaData.java:176) at oracle.jdbc.driver.OracleParameterMetaData.getParameterType(OracleParameterMetaData.java:327) at org.springframework.jdbc.core.StatementCreatorUtils.setNull(StatementCreatorUtils.java:262) {code}

    Spring JIRA | 1 year ago | Tom Jahncke
    java.sql.SQLFeatureNotSupportedException: Unsupported feature
  2. 0

    This relates to: https://jira.spring.io/browse/SPR-11100 Using the oracle driver (ojdbc7 version 12.1.0.2.0) I ran across the following issue (I opened a support case with Oracle on the root cause of the issue. SR 3-11927085951) Normally the Oracle driver works fine with following code: {code} sqlTypeToUse = ps.getParameterMetaData().getParameterType(paramIndex); (from setNull in StatementCreatorUtils line 262) {code} However, it is possible for a statement to cause Oracle to throw an exception than then all statements going forward no longer use the JDBC 3.0 features to resolve the sql data type for null values. I understand why driversWithNoSupportForGetParameterType exists and how it helps performance. However, since it is black or white once an exception is thrown the setNull never tries to use the JDBC 3.0 features again (until the app is restarted). I can think of a few hackish ways to address this, but I am hoping you can come with a solid solution that is solid (My hackish ideas are along the lines or allowing a driver name to be injected that doesn't get added to the global set of drivers not supported.) FYI, just by having an insert statement with a qualified table name causes the following exception with the oracle JDBC driver. (Without qualification no exception.): {code} java.sql.SQLFeatureNotSupportedException: Unsupported feature at oracle.jdbc.driver.OracleParameterMetaData.checkValidIndex(OracleParameterMetaData.java:176) at oracle.jdbc.driver.OracleParameterMetaData.getParameterType(OracleParameterMetaData.java:327) at org.springframework.jdbc.core.StatementCreatorUtils.setNull(StatementCreatorUtils.java:262) {code}

    Spring JIRA | 1 year ago | Tom Jahncke
    java.sql.SQLFeatureNotSupportedException: Unsupported feature

    1 unregistered visitors

    Root Cause Analysis

    1. java.sql.SQLFeatureNotSupportedException

      Unsupported feature

      at oracle.jdbc.driver.OracleParameterMetaData.checkValidIndex()
    2. Oracle jdbc
      OracleParameterMetaData.getParameterType
      1. oracle.jdbc.driver.OracleParameterMetaData.checkValidIndex(OracleParameterMetaData.java:176)
      2. oracle.jdbc.driver.OracleParameterMetaData.getParameterType(OracleParameterMetaData.java:327)
      2 frames
    3. Spring Framework
      StatementCreatorUtils.setNull
      1. org.springframework.jdbc.core.StatementCreatorUtils.setNull(StatementCreatorUtils.java:262)
      1 frame