4 Replies Latest reply: Jan 14, 2014 9:51 AM by JDeveloper Newbie (11.1.1.6.0) RSS

Error: java.sql.SQLException: Unsupported feature at oracle.jdbc.driver.OracleParameterMetaData.getParameterMode(OracleParameterMetaData.java:320)

JDeveloper Newbie (11.1.1.6.0) Explorer
Currently Being Moderated

Hi everyone,

 

I have the following proof-of-concept method for using ParameterMetaData, but it bombs at the red statement below with the following error: java.sql.SQLException: Unsupported feature at oracle.jdbc.driver.OracleParameterMetaData.getParameterMode(OracleParameterMetaData.java:320).

 

Here is the method which is in my ServicesAMImpl class:

 

    public void x() throws Exception {

        PreparedStatement pstmt =

            getDBTransaction().createPreparedStatement("select * from dual where dummy = ?", 0);

        ParameterMetaData paramMetaData = null;

        paramMetaData = pstmt.getParameterMetaData();

        if (paramMetaData == null) {

            System.out.println("db vendor does NOT support ParameterMetaData");

        } else {

            System.out.println("db vendor supports ParameterMetaData");

            // find out the number of dynamic parameters

            int paramCount = paramMetaData.getParameterCount();

            System.out.println("paramCount=" + paramCount);

            System.out.println("-------------------");

            for (int param = 1; param <= paramCount; param++) {

                System.out.println("param number=" + param);

                int paramMode = paramMetaData.getParameterMode(param);

                System.out.println("param mode=" + paramMode);

                if (paramMode == ParameterMetaData.parameterModeOut) {

                    System.out.println("the parameter's mode is OUT.");

                } else if (paramMode == ParameterMetaData.parameterModeIn) {

                    System.out.println("the parameter's mode is IN.");

                } else if (paramMode == ParameterMetaData.parameterModeInOut) {

                    System.out.println("the parameter's mode is INOUT.");

                } else {

                    System.out.println("the mode of a parameter is unknown.");

                }

            }

        }

        pstmt.close();

    }

 

All of this Java development is in the context of ADF, so I was not sure if I should post here or in the Java Programming space.

 

James

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points