File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Interview question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Interview question" Watch "Interview question" New topic

Interview question

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
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

Dana Hanna
Ranch Hand

Joined: Feb 28, 2003
Posts: 227
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

Joined: Aug 13, 2003
Posts: 109
Dear Hanna,
What did u mean from re-use of Statement.?
Plz kindly elaborate,i'm kinda new to JDBC.
Thank you

SCJP 1.4<br />SCBCD 1.3
I agree. Here's the link:
subject: Interview question
It's not a secret anymore!