I´m a little bit frustrated with my Java environment that didn´t allow me to call the method OraclePreparedStatement#setPlsqlIndexTable
... but i think i should write the code before...
String plSqlBody = "some pl/sql procedure call"
/*
* The PL/SQL procedure parameter is here of type
* TYPE t_date_table IS TABLE OF DATE INDEX BY PLS_INTEGER;
*/
OracleCallableStatement ocs = (OracleCallableStatement)
conn.prepareCall(plSqlBody);
java.util.Date[] date = new java.util.Date[10];
// Initialise the array... and then...
ocs.setPlsqlIndexTable(index, date, 20, 20, OracleTypes.DATE, 20);
And here i get my exception:
java.sql.SQLException: Ungültiger PL/SQL-Indextabellen-Elementtyp
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
I didn´t find a solution for the problem. I changed the Java type from java.util.Date
to java.sql.Date
/ oracle.sql.DATE
and OracleTypes.DATE
to OracleTypes.TIME
/ OracleTypes.TIMESTAMP
, but nothing solved the problem. I find somewhere the hint, that these types are not allowed here, but i can´t believe it. Do you know the right way here?