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 Statement Vs PreparedStatement ? 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 "Statement Vs PreparedStatement ?" Watch "Statement Vs PreparedStatement ?" New topic

Statement Vs PreparedStatement ?

Seshaiah Chimata

Joined: Aug 02, 2012
Posts: 5

Why do we need Statement when there is a more benefit with PreparedStatement (Pre-compiled in database after first hit)?
I mean in which scenario we should use Statement interface instead of PreparedStatement interface ?

Wendy Gibbons

Joined: Oct 21, 2008
Posts: 1107

can you do DDL in prepared statements eg create table?
I agree. Here's the link:
subject: Statement Vs PreparedStatement ?
It's not a secret anymore!