Hi Normally whenever any one asks question on difference between Statement & Prepared Statement My reply is I dont bother about Statements . We dont require them. Whatever we can acheive with Statement can also be done with Prepared Statements. Interviewer says : There is something with statement which we cant do with a Prepared Statement. If there is such a thing Can some one let me know. Why cant we have bind variables with statements
With a Statement, you can re-use it and execute a different query everytime. Not having binding statements - good question. I think that it has to do with database functionality, and what they are setup to do. The prepare statement was originally for using database prepare call functionality. Now we find ourselves using it to bind variables. They ought to change the API!