This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
Don't get me started about those stupid light bulbs.
 
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