inner ex 2 =A result was returned when none was expected.
I don't know what is or is not allowed by JDBC but it is reasonable to assume that you cannot create batches of SELECT statements. The intent of batching is to repeatedly execute the same INSERT statement multiple times while using different values for parameters.
I would suggest probably writing INSERT onto a temporary table and then writing a plpgsql function that would then process said temporary table.
David J.