CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JDBC DETAILS
Question :
Why do we use prepared statement when already statement is present

Category JDBC Interview Questions
Rating (0.0) By 0 users
Added on 7/14/2006
Views 1282
Rate it!
Answers:

Actually when u submit a simple statement to the databse, at first the DBMS parses it and sends it back with the result, so again when u send the same statement again the DBMS server parses it and sends back the result so here a lot of time is wasted and because the statement is again parsed though it has been sent twice or thrice it consumes a lot of time and response will be slow.Prepared Statement is used when u want to execute a statement object many times. when u submit a PreparedStatement the DBMS server parses it and creates a execution plan. This e-plan can be used when u again send the same statement to the database.That is the DBMS server zest executes the compiled statement rather that executing it from first, hence we get an precompiled statement.And also the advanatge of using this PreparedStatement is it is used to send dynamic sql statements, which u can give values later than giving the values at the time of creation.



prepared statement compile only once at start while statement compiles every time when we run a java file.



 Posted by: vivek singh    

Contact vivek singh  Contact vivek singh


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
Which is the best driver among the 4 jdbc drivers?how can we load that driver?

View Answer
How many statements can be created with one connection
View Answer
If 4 different drivers are loaded, & created 4 different statements calling diffener tables from same database, how driver is recognized for each statement?
View Answer
What is metadata?
View Answer
Where to use which driver in JAVA?
View Answer
what is savepoint?
View Answer
How differ servlet from its peer Technology?
View Answer
What is the importance in context in jdbc connection pools?

View Answer
how can we connect database in java without using the Class.forname() method with our application?
View Answer
The interface _____________ helps us in retrieving the information about the database.
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL JDBC Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/5004/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.67