Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is execute(), executeUpdate() and executeQuery()
methods?

Answers were Sorted based on User's Feedback



What is execute(), executeUpdate() and executeQuery() methods?..

Answer / srinivasan

execute() - will do the querying the database & also the
update,insert,delete on the database.

executeUpdate() - only the update,insert,delete on the
database.

executeQuery() - only the querying the database.

Is This Answer Correct ?    80 Yes 23 No

What is execute(), executeUpdate() and executeQuery() methods?..

Answer / bhoopesh alladi

execute()- is for invoking the functions or stored
procedures of SQL by the CallableStatement.

executeUpdata()- is for the operations such as insert,
update or delete on SQL by PreparedStatement, Statement.

executeQuery() - is for operation select of Sql by
PreparedStatement or Statement.

Is This Answer Correct ?    69 Yes 21 No

What is execute(), executeUpdate() and executeQuery() methods?..

Answer / trio

boolean execute()
Executes the SQL statement in this PreparedStatement
object, which may be any kind of SQL statement.

ResultSet executeQuery()
Executes the SQL query in this PreparedStatement object and
returns the ResultSet object generated by the query.

int executeUpdate()
Executes the SQL statement in this PreparedStatement
object, which must be an SQL INSERT, UPDATE or DELETE
statement; or an SQL statement that returns nothing, such
as a DDL statement.

Is This Answer Correct ?    39 Yes 4 No

What is execute(), executeUpdate() and executeQuery() methods?..

Answer / kirthi

executeQuery() --- This is used generally for reading the
content of the database. The output will be in the form of
ResultSet. Generally SELECT statement is used.

executeUpdate() --- This is generally used for altering the
databases. Generally DROP TABLE or DATABASE, INSERT into
TABLE, UPDATE TABLE, DELETE from TABLE statements will be
used in this. The output will be in the form of int. This
int value denotes the number of rows affected by the query.

execute() --- If you dont know which method to be used for
executing SQL statements, this method can be used. This
will return a boolean. TRUE indicates the result is a
ResultSet and FALSE indicates it has the int value which
denotes number of rows affected by the query.

Is This Answer Correct ?    22 Yes 1 No

What is execute(), executeUpdate() and executeQuery() methods?..

Answer / sree

executeUpdate() is for non selecting statements
executeQuery() is for selecting statements.

Is This Answer Correct ?    21 Yes 18 No

What is execute(), executeUpdate() and executeQuery() methods?..

Answer / boomiraj.p

executeUpdate() : is used to update the data using "insert,update and delete" statements.Send the data from fron t end to back end.

executeQuery() : used to select the data using "select" statement.Retrieve the data from back end to front end.

Is This Answer Correct ?    6 Yes 5 No

What is execute(), executeUpdate() and executeQuery() methods?..

Answer / 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

What is execute(), executeUpdate() and executeQuery() methods?..

Answer / kundlik

execute():-execute method is used to fire DDL Command means (CREATE,ALTER,DROP Etc) on to the database,It's return type is true or false.

executeUpdate():Its used to fired DML Command on to the database. like (insert,update,delete) etc.its return type is ResultSet.


executeQuery():is used to only retrieve data from database.

Is This Answer Correct ?    1 Yes 0 No

What is execute(), executeUpdate() and executeQuery() methods?..

Answer / sreenivaslu

booleanExecute() method is execute both select and non
select queris are executed

Is This Answer Correct ?    7 Yes 7 No

What is execute(), executeUpdate() and executeQuery() methods?..

Answer / bharat

executeUpdata()= is for the operations such as Insert,
update and delete on SQL by PreparedStatement or Statement.

executeQuery()= is for operation select of Sql by
PreparedStatement or Statement.

Is This Answer Correct ?    5 Yes 6 No

Post New Answer

More JDBC Interview Questions

Explain the steps in writing a java program using jdbc?

0 Answers  


HI ALL, How to Overcome "OutOfMemoryException"? when I am compiling source having more than 1000 LOC throwing this exception. Can any one give correct answer to my question? thx

5 Answers  


What is jdbc servlet?

0 Answers  


What is the return type of execute, executequery and executeupdate?

0 Answers  


How a driver can be loaded?

1 Answers  


What is jdbc dialect?

0 Answers  


What is jdbc architecture in java?

0 Answers  


What are JDBC Best Practices?

0 Answers  


What is jdbc? Describe the steps needed to execute a sql query using jdbc.

0 Answers  


What is the difference between Union, Unionall ?

1 Answers  


What is thin driver in jdbc?

0 Answers  


What does connection pooling mean ?

0 Answers  


Categories