Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do you pass a null array to OracleCallableStatement.setPlsqlIndexTable()?

 
Kent Wan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Upgrading code to jdk1.6 using ojdbc6.jar.

Our current code looks something like below and works fine with ojdbc14.jar.

ps = (OracleCallableStatement) mConn.prepareCall("begin index_by_table_test.do_stuff(:1); end;");
int[] blah = null;
ps.setPlsqlIndexTable(1, blah, 0, 0, OracleTypes.NUMBER, 100);
ps.execute();

The runtime implementation of OraclePreparedStatement.setPlsqlIndexTableInternal has changed in ojdbc6.jar and now contains a specific null check so get a sqlException when executing the statement. I can do the following

ps = (OracleCallableStatement) mConn.prepareCall("begin index_by_table_test.do_stuff(:1); end;");
int[] blah = new in[]{0};
ps.setPlsqlIndexTable(1, blah, 1, 1, OracleTypes.NUMBER, 100);
ps.execute();

but need to alter the StoredProcedure to deal with the new value.

Is there any other way round this other than coding around the change in the api?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic