For some reason the JDBC PostgreSQL driver is adding: RETURNING * to the end of select statements. Why?
Code:
protected
The easiest way I've done this was adding ";--" at the end of sql code:
String sql = "INSERT INTO testTable(var1, var2) values ("1","2"), ("1","2") RETURNING id;--";
PreparedStatement ps = getConnection().prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.executeUpdate();
ResultSet rs = ps.getGeneratedKeys();