Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interview question

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Rgrds
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Raja Sagar Panamgipalli
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Hanna,
What did u mean from re-use of Statement.?
Plz kindly elaborate,i'm kinda new to JDBC.
Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic