If a client issues something like:
s = c.prepareStatement("");
s.executeUpdate();
The current logic will throw an exception on prepare.
It's expected for the prepare to complete an an empty statement response to be returned from execute.
This is the logic that is used by the PG JDBC driver for connection.isValid.