Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes Can I use prep.execute to update a record? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Can I use prep.execute to update a record?" Watch "Can I use prep.execute to update a record?" New topic
Author

Can I use prep.execute to update a record?

Ryan Webb
Greenhorn

Joined: Dec 09, 2009
Posts: 28
Hello ranchers!

I just want to confirm if I can use prep.execute(sql) to update a database record instead of prep.executeUpdate(sql)?

where sql = "UPDATE <table> SET <column> = '<data>'";

Thanks!
Ryan Webb


frustrated to learn c/c++/objective-c
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

from the API doc:

Executes the SQL statement in this PreparedStatement object, which may be any kind of SQL statement. .....


OCUP UML fundamental and ITIL foundation
youtube channel
Ryan Webb
Greenhorn

Joined: Dec 09, 2009
Posts: 28
Oh i see! Thanks!

Ryan Webb
 
Consider Paul's rocket mass heater.
 
subject: Can I use prep.execute to update a record?
 
Similar Threads
Update based on Row id
native SQL update in Hibernate
Record-Level Locking In JDBC
ejbcreate() and ejbStore()
CMT & Transaction Attribute