aspose file tools*
The moose likes JDBC 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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Add/Modify db methods in a bean" Watch "Add/Modify db methods in a bean" New topic
Author

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: 15299
    
    6

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: http://aspose.com/file-tools
 
subject: Add/Modify db methods in a bean