Hello, I am trying to update an array of integers using a prepared
statement.
Column "categories" in the table "records" is of type integer[]
String updateSQL = "UPDATE records SET categories = ? WHERE id = ?;";
PreparedStatement updateStatement = getConnection().prepareStatement
(updateSQL);
int[] test = {11,22,33};
updateStatement.setObject(1, test);
updateStatement.setInt(2, 123);
updateStatement.execute();
I get the following error:
ERROR: java.sql.SQLException: No such SQL type: 2003
I also tried Integer[]. Same problem.
Is there any way to make this work?
Thanks!