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?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sqlwarning and discuss the procedure of retrieving warnings?

950


Does jdbc require oracle client?

886


What protocol does jdbc use?

921


What is resultset?

938


Can we return resultset in java?

864


What packages are used by jdbc?

902


What is the return type of class.forname() method?

905


What is the JDBC?

997


How do I disallow NULL values in a table?

930


Explain the various types of locking system in jdbc?

829


What is JDBC Driver interface?

1051


What is jsp and jdbc?

853


Why we use jdbc instead of odbc?

913


What is jdbc odbc bridge in java?

1002


Is jdbc a web technology?

844