49. What is the difference between statement and prepared statment?

  • Prepared Statement is Pre-compiled class , but Statement is not.
  • So in PreparedStatement the execution will be faster.

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.


12 Responses

  1. nothing

  2. Nice. I just cleared the job. thks

  3. nice boobs:)

  4. This is sufficient and enough theory to understand

  5. please give me full details

  6. Where is the execution plan Stored ? I just want to ask where is the precompiled statement stored ?

    Is it stored in JVM or the Database ?

  7. site pixe is not fix , Visibiliy is not clear
    Please set this thing ASPS.

  8. Just give full details.

  9. uyiiiiiiiiiiiiir7876767676

  10. its’ all same no?

  11. very short and nice….

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: