• 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?
 
We begin by testing your absorbancy by exposing you to this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!