That sql will not work with jdbc.
What you are doing is binding an array of ints to a single "?" sql parameter. What you will need to do is to calculate number of elements in the productIds array and for each element in array you must have corresponding "?" in your where clause.
For example:
if you array has 2 elements
productIds[0] = 1;
productIds[1] = 123;
your sql will look like this
delete from product where id in ( 1, 123)
and you must pass an array of Integers to the execute method
Code:
String query = "delete from product where id in (";
StringBuffer sqlParams = new StringBuffer();
Object arr[] = new Integer[productIds.length];
if (int i = 0; i < arr.length; i ++)
{
sqlParams.append("?");
if (i < arr.length) sqlPrams.append(",");
arr[i] = new Integer(productIds[i]);
}
query = query + sqlParams.toString() + ")";
execute(query, arr);
Dmitry