This content has been marked as final. Show 1 reply
I am calling this java, however I am getting exception. How can I resolve this error?
By using the proper syntax.
Says that an array will be used but doesn't say which array. You have to specify the actual Oracle type name as the third parameter.
The two-parameter format is fine for standard data types since a date is a date and a varchar is a varchar2. But an array is not an array; the contents of an array can be different so the array definition is needed.
See 11 Accessing and Manipulating Oracle Data in the JDBC Dev guide
Other setXXX Methods
As with the getXXX methods, there are several specific setXXX methods. Standard setXXX methods are provided for binding standard Java types, and Oracle-specific setXXX methods are provided for binding Oracle-specific types.
. . .
Similarly, the registerOutParameter method has a signature for use with REF, ARRAY, or STRUCT data:
(int parameterIndex, int sqlType, String sql_type_name)
The type name (dates for your case) is needed to get the type definition metadata from the database in order to construct the proper buffer object.
I strongly recommend that you not use object names such as 'dates' that so closely resemble reserved words; that is asking for trouble.