• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!