What is execute(), executeUpdate() and executeQuery()
methods?
Answer Posted / ratheesh.a
executeQuery(): This is a method/function used in jdbc
programs. this method will return a 'Resulset' object.
Through this method we can access the result of the query
Usually the Select query is used here..
executeUpadte(): This method is mainly used for updating
queries.. such as 'insert,update,delete' etc... returns an
integer value which shows how many rows are updated...
execute() :What ever the sql queries we are giving in the
other 2 methods can also be include here
This will return a boolean value if it returns 'true' means
query executed successfuly else not..
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is DML?
What do you mean by odbc?
What are the benefits of PreparedStatement over Statement?
What is addbatch jdbc?
Explain the process of creating tables using NetBeans IDE?
What is difference between java.util.Date and java.sql.Date?
Why we use jdbc instead of odbc?
How to achieve JDBC Connection Pooling using JDBC DataSource and JNDI in Apache Tomcat Server?
What is the fastest type of JDBC driver?
How many ways that we can view a result set?
How can I write to the log used by DriverManager and JDBC drivers?
Why should we close database connections in java?
Where can I find ojdbc14 jar file?
Is there another way of dealing with the result set that could execute faster?
What class.forname will do while loading drivers of jdbc?