When stmt.executeUpdate() method is called the following steps can be carried out
- The JDBC driver sends the sql statement to the database server.
- The database server parses the sql statement to analyze the wether the statement is correct or not.
- If the statement is correct the database server executes the statement.
Note: executeUpdate() method returns an integer indicating the number of rows effected by that statement.
String sql="insert into employee values(100,'emp1','US')"; Statement stmt=con.createStatement(); int n=stmt.executeUpdate();
From the above code 1 will be returned, indicating that the statement is inserted one row into table.
Note:For create table, drop table and alter table executeUpdate() method returns 0