what is difference between excute query ()and execute update
()?

Answers were Sorted based on User's Feedback



what is difference between excute query ()and execute update ()?..

Answer / ashwani

execute query() returns a single resultset object.
exceute update() excecutes the insert, update and the delete
operation of the sql statement.This returns the integer
value or say the number of record affected by the SQL
statement execution.

Is This Answer Correct ?    15 Yes 1 No

what is difference between excute query ()and execute update ()?..

Answer / mano

execute query() used in select operation.
execute update() is used in delete, update and insert
operations.

Is This Answer Correct ?    10 Yes 1 No

what is difference between excute query ()and execute update ()?..

Answer / gambhir

executeQuery() is used to perform DDL operation like
(create,alter) while executeUpdate() is used to perform DML
operation like (insert/update/delete).

Is This Answer Correct ?    6 Yes 2 No

what is difference between excute query ()and execute update ()?..

Answer / vikneswarank

excuteQuery() its method used perform select query and
delete query return ResultSet object.
excuteUpdate() used to perform DML operation return type
int

Is This Answer Correct ?    5 Yes 1 No

what is difference between excute query ()and execute update ()?..

Answer / megala devi

Execute query():it is using for DML(Data definition
language) and DDL (Data Manipulation Language)and mainly its
used for select query
example:String sql="select * from Employee_Details";
st.executequery(sql);

Execute update():it is using for DML(Data definition
language) and DDL (Data Manipulation Language)and mainly its
used for insert query,update query,delete
example:String sql="insert into Employee_Detail........";

st.executeUpdate(sql);

Is This Answer Correct ?    2 Yes 0 No

what is difference between excute query ()and execute update ()?..

Answer / naresh

executeQuery() method used for only selecting the records
and its return value is in the form of ResultSet Object.

executeUpdate() method used for DDL and DML commands and
its returns the int value.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

what do you understand by synchronization? : Java thread

0 Answers  


What’s a deadlock?

0 Answers  


How many classes can any class inherit java?

0 Answers  


What is the right data type to represent a price in java?

0 Answers  


How will you convert an ArrayList to Arrays?

4 Answers   KPIT,






What is the main use of java?

0 Answers  


how your day start in your company

1 Answers  


This is my code i have a doubt class ab implements a,b { public void add() { System.out.println("Hi") } } interface a { public void add(); } interface b { public void add(); } in this code i have two interface implemented in the class has same method.just i want to know which method of interface implemented in the class. interface a or interface b? confused me .

3 Answers  


Difference between Application and Applet ?

4 Answers   Wipro,


Explain the different forms of polymorphism?

0 Answers  


What is the range of the short type?

0 Answers  


There is a Banking application. It has 2 types of account, Savings and Current. Write a method calculateInterest by passing an ArrayList of these account objects and calculate Interest accordingly. Write code for this situation

1 Answers   ABC, KPIT,


Categories