Hi,
> String sql = "select test_user_result_insert_func(?, ?, ?);";
You can't call functions via JDBC like that. You need to use:
CallableStatement cs = connection.prepareCall("{call func(?,?,?)}");
// Loop starts...
cs.clearParameters();
cs.setString(1, "foo");
cs.setString(2, "bar");
cs.setString(3, "baz");
cs.addBatch();
// Loop ends
cs.executeBatch();
See also: https://jdbc.postgresql.org/documentation/94/callproc.html
Best regards,
-hannes