aspose file tools*
The moose likes JDBC 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
Bookmark "Interview question" Watch "Interview question" New topic
Author

Interview question

manish ahuja
Ranch Hand

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

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: http://aspose.com/file-tools
 
subject: Interview question