Used for SQL SELECT queries
Returns the ResultSET object that contains the results of the query and can be used to access the query results.
String sql = “SELECT * from sometable”;ResultSet rs =stmt.executeQuery(sql); executeUpdate(sql)method
This method is used for executing an update statement like INSERT, UPDATE or DELETE
Returns an integer value representing the number of rows updated
String sql = “INSERT INTO tablename ” + “(columnNames) Values (values)” ; int count = stmt.executeUpdate(sql);
0 Comments
Please add nice comments or answer ....