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 Statement and PreparedStatement? whatz the
difference?

Answers were Sorted based on User's Feedback



What is Statement and PreparedStatement? whatz the difference?..

Answer / harish

When you execute a SQL query with Statement. It parses and
executes in the database each time. Where as in
PreparedStatement, first time it parses and executes and
subsequent times, it directly substitute the values in the
query and executes. It is faster than Statement

Is This Answer Correct ?    11 Yes 2 No

What is Statement and PreparedStatement? whatz the difference?..

Answer / kalyan

As harish, said prepared statement is pre-complied so it
will be very fast when compared to normal statement.when we
execute same query again and again for different set of
input data.

code snippet for this is :--


for normal statement :

Statement st = conn.createStatement();

for prepared statement :

PreparedStatement prSt = conn.prepareStatement
("query") ;

// set values for input paramenters and execute as usual.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More JDBC Interview Questions

What is the meaning of connection?

0 Answers  


What is an SQL Locator?

0 Answers  


Which is better odbc or jdbc?

0 Answers  


Can you define a foreign key, with a key from the same table?

2 Answers   IBM,


what are the types of result sets in JDBC 3.0 ?

3 Answers   HCL,


Which constraint cannot be specified as an explicit constraint and should be specified with the column only ?

0 Answers  


Explain the role of driver in jdbc.

0 Answers  


What is correlated subquery?

0 Answers   emc2, JK Technosoft,


Which is best database for java?

0 Answers  


What are the functions of the jdbc connection interface?

0 Answers  


wa is connection pooling? how do u create connection pooling?wat is use connection pooling?

1 Answers   Covansys,


Why are we using blob datatypes in jdbc?

0 Answers  


Categories