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 Can we use PrepareStatement for deleting? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Can we use PrepareStatement for deleting?" Watch "Can we use PrepareStatement for deleting?" New topic

Can we use PrepareStatement for deleting?

Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
And I think answer to this question should be yes
but when I am using it and calling the update function from my jsp
it do not seem to work
As far as I think this syntax is correct
void update()
PreparedStatement pstmt = con.prepareStatement("delete from table where colname= ?");
Correct me anyone if I am wrong?

SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
Raja Shekhar
Ranch Hand

Joined: Apr 02, 2001
Posts: 49
Hi Gaurav..
The Syntax is wrong...
change it to
I agree. Here's the link:
subject: Can we use PrepareStatement for deleting?
It's not a secret anymore!