i am having trouble with the prepared statement batch excecuter:
try{
while (operatorsQuery.next()) {
phone = Integer.toString(operatorsQuery.getInt(1));
prepStmt1 = connBlng.prepareStatement("update table set done='yes' where phone=?");
prepStmt1.setString(1, phone);
prepStmt1.addBatch();
}
prepStmt1.executeBatch();
} catch(Exception e){
e.printStackTrace();
} finally{
closeStatmentandRS(operatorsQuery, prepStmt1);
}
and for some reason it only updates the last batch(last phone).
why is that happening?