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

Which jdbc driver is the fastest driver?

984


How do I load a database driver with JDBC 4.0 / Java 6?

952


What is jdbc servlet?

921


What is JDBC Savepoint? How to use it?

1143


What is jdbc and odbc in java?

874


What are the utilities of the callablestatement?

944


What is jdbc connection?

1053


What is the use of setFetchSize() and setMaxRows() methods in Statement?

952


What does jdbc setmaxrows method do?

915


What is the difference between setmaxrows(int) and setfetchsize(int)?

996


What are 4 drivers available in JDBC? At what situation are four of the drivers used?

908


How many types of jdbc drivers are available?

896


If I use the JDBC API, do I have to use ODBC underneath?

984


Explain the difference between inner and outer join ?

964


Is jdbctemplate thread safe?

867