How to use IN clause with PreparedStatement in PostgreSQL
问题 I have to write a SQL query for Postgres database as follows: DELETE FROM employee WHERE ename IN (?) I want to pass ename as list or string which will contain multiple employee names, e.g. "abc, bcd, efg" . How to set the values? How to use IN clause with PreparedStatement in Postgres? 回答1: There are several ways to do this. The clean way is to pass an array to the prepared statement. An alternative to Nick's answer is to pass a proper java.sql.Array value: PreparedStatement pstmt =