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

How to achieve JDBC Connection Pooling using JDBC DataSource and JNDI in Apache Tomcat Server?

1068


How can we set null value in jdbc preparedstatement?

1005


How do I receive a ResultSet from a stored procedure?

1012


What is resultset in jdbc with example?

989


How to test jdbc connection to sql server?

1065


What is difference between java.util.Date and java.sql.Date?

1194


Why would you use setautocommit(false) in jdbc?

1264


Name the types of jdbc drivers.

955


How the JDBC application works?

1002


What does executeupdate return in jdbc?

1016


What is JDBC Statement?

1039


What is meant by dao?

993


What is metadata in programming?

1059


What is jdbc url for mysql?

1083


What are the differences between stored procedure and functions?

1072