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 Add/Modify db methods in a bean 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 "Add/Modify db methods in a bean" Watch "Add/Modify db methods in a bean" New topic

Add/Modify db methods in a bean

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
Ok I am writign an application that has a form on it that you can create or modify a record. Currently, When you bring up a pre-populated form I delete all the info that was listed in the db for where the form datd would be stored than use this new information to repopulate these fields?
I really did not wnat to do a comparison, but do I need to? What if a get some kind of flipped error before the bean finshes, where it dies after I delete the info and before I update the new info?
What should I do? What do most do for modifying stuff?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

I usually don't delete what is in the database, and then rewrite everything. If I am doing an update, then I simply do the UPDATE SQL Command. It will over-write what is currently on the database in those fields you are UPDATING.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: Add/Modify db methods in a bean
It's not a secret anymore!