It should be
query="insert into ABC values (?, ?, ?)";
PreparedStatement pst = conn.prepareStatement(query);
for(int i=0;i<100;i++){
pst.setString(1,"a");
Wei is right. If that was done in a way that actually compiled, you'd be creating a new statement in every iteration of the loop, every of which would contain one row in the batch, and only execute the batch of the last created instance.