Forums Register Login

Statement v/s PreparedStatement

+Pie Number of slices to send: Send
Hi all,

PreparedStatement is called pre compiled statement but Statement is not why?
How PreparedStatement is pre compiled?

Regards,
ABHIJIT
+Pie Number of slices to send: Send
In case of PreparedStatement, the skeleton of an SQL statement is prepared/compiled during it's creation/instantiation.
For e.g.

place holders (? marks) are used instead of actual values, this skeleton is compiled before going to execute with the actual values, as follows:

----------------
In case of Statement, no SQL statement is prepared/compiled during creation/instantiation.
For e.g.
.
Later, the SQL statement with values together executed as follows:







See where your hand is? Not there. It's next to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1049 times.
Similar Threads
Diff b/w Statement and PreparedStatement
Prepared Statement
statement Vs prepared statement for ordinary select queries
Tell me the main difference between Statement and PreparedStatement?
pre-compile and prepared statement
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:17:05.