Jinhua>So that's what I mean prepared statement should be created dynamically
Jinhua>depending how much you calls addBatch() before executeBatch().
Just grab the current pgjdbc master branch (e.g. via 9.4.1209-SNAPSHOT
maven snapshot),
and add reWriteBatchedInserts=true connection property.
We'll be glad to hear your results on the feature.
The feature is not yet enabled by default, however it might be changed
in the future.
See more in https://github.com/pgjdbc/pgjdbc/pull/491
Vladimir