Thursday, April 10, 2008 01:21 PM
Hi Asm Asud,
If you use above two code snippet in your application, from result prespective there in no difference.
But as might you know that PrepareStatement is the one which will compiled only once and you can use it's setXXX() method to set the value dynamically.
The main difference between above tow code snippet is that, in
Case 1 : the prepare statement is going to compile everytime and new prepare statement is going to be created.
While in Case 2: , after executing 1st line statement is compiled and you can use it after wards, you just need to set the value.
Hope so this will clarify your doubts.
Thanks and Regards,