wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Database modification 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 » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Database modification" Watch "Database modification" New topic
Author

Database modification

Pallav Grigo
Greenhorn

Joined: Mar 29, 2002
Posts: 29
I have a question about the modify(DataInfo info) method in the Data class. Which fields of the database are allowed to be modified by the client? The flight number and the number of free seats are definitely not to be modified directly since the first is the primary key and the latter is to be modified by the bookFlight() method. What if the administrator had to change some flight info such as the time or the duration or for that matter the origin/destination? Any response is appreciated.
Regards,
Pallav
Adam Roberts
Ranch Hand

Joined: Mar 18, 2002
Posts: 71
If I remember correctly, pretty much any field can be changed by the client. Obviously, if you change the flight number, you won't be able to modify anything because the record can not be identified. All the method does is find the related DataInfo object, checks it, and replaces it with the one passed through the method.
Your bookFlights method will have to either modify the DataInfo then resend it, or create a new DataInfo based on the information in the old one with modified flight numbers.
Hope that helps


Adam Roberts - SCJP2, SCJD<br />insert witty something here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database modification