PreparedStatement pstmt = con.prepareStatement("UPDATE table4 SET m = ? WHERE x = ?");
pstmt.setLong(1, 123456789);
pstmt.setLong(2, 100000000);
pstmt.setString(1, "Hi");
for (int i = 0; i < 10; i++)
{
pstmt.setInt(2, i);
int rowCount = pstmt.executeUpdate();
}