I'm trying to bind a prepared statement parameter which is a array PostgreSQL. Here's an example Query:
prepareStatement("UPDATE " + emailsFromDb.get(i) + " SET columne =testvalue '," + id + "' WHERE id IN (?)" );
I read from txt file value as array this is code read from txt
Scanner inFile1 = new Scanner(new File("file.txt"));
while(inFile1.hasNext()) {
sb.append(inFile1.nextLine());
}
String[] testArray = sb.toString().split(", ");
and prepare the array in sql
Array bulkarr= connector.createArrayOf("INT", testArray);
pr.setArray(1, bulkarr);
pr.executeUpdate();
and the result I have this error
2017-11-02 17:12:58 --ERROR-ApplicationErrorMessage :
org.postgresql.util.PSQLException: ERROR: operator does not exist: integer = integer[]
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Position: 106
I need to update with where in array postgres