What is the difference between ExecuteUpdate and
ExecuteQuery?

Answers were Sorted based on User's Feedback



What is the difference between ExecuteUpdate and ExecuteQuery?..

Answer / anji

executeUpdate() - is used to update or modify the table, it
will returns howmany rows added/updated in the table.

executeQuery() - is used to retrieve the data from the
table. only for "select" query, this will return a
Resultset metadata

Is This Answer Correct ?    42 Yes 2 No

What is the difference between ExecuteUpdate and ExecuteQuery?..

Answer / vishnuvardhan

ExecuteUpdate method will return integer value.
ExecuteQuery method will return ResultSet value.

Is This Answer Correct ?    45 Yes 7 No

What is the difference between ExecuteUpdate and ExecuteQuery?..

Answer / balu

executeUpdate() --is used for executing non-select
statements

executeQuery() - is used for executing select statements

The above two are valid in SQLServer
Note: but i think in case of Oracle executequery()may also
accept non-select statements

Is This Answer Correct ?    19 Yes 2 No

What is the difference between ExecuteUpdate and ExecuteQuery?..

Answer / fiza

when we seach any record from database we call the execute
query and when we write in database we call the update
method

Is This Answer Correct ?    15 Yes 3 No

Post New Answer

More Servlets Interview Questions

What methods do you use in servlet - applet communication?

0 Answers  


What is a generic servlet?

0 Answers  


Why servlet is used as controller ? Not JSP? I want complete explation?

0 Answers   Tech Mahindra,


How to read request headers from servlets?

0 Answers  


What do you mean by a filter and how does it work?

0 Answers  






How do you communicate in between Applets and Servlets?

0 Answers  


Can we use servlets in JavaScript?

2 Answers  


What do you mean by cgi and what are its drawbacks?

0 Answers  


What is servlet in simple terms?

0 Answers  


why are using HttpServlet in realtime projects and why are not using Genericservlet

2 Answers  


What are the two important api's in for servlets?

0 Answers  


What are the types of servlet?

0 Answers  


Categories