File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Database modification" Watch "Database modification" New topic

Database modification

Pallav Grigo

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.
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:
subject: Database modification
It's not a secret anymore!