Please tell me which out of the two methods, executeUpdate and execute is the best one for an insert query like insert into users(name, addr, city, sex, dob) values(?,?,?,?,?);Both the statements would execute the query but which one should be ideally used for an insert query?
Please tell me which out of the two methods, executeUpdate and execute is the
Share
The return value differs. ExecuteUpdate() returns the number of rows updated, which can be useful when running an update statement. In your case it is not needed, since you know how many records you are inserting. You can use either one.