File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Should we store the msg about passenger ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Should we store the msg about passenger ?" Watch "Should we store the msg about passenger ?" New topic
Author

Should we store the msg about passenger ?

Ray Cheeny
Ranch Hand

Joined: Aug 21, 2002
Posts: 74
Hi Friends,
I have some questions
If the user click the booking button,what should I do then?Record the user name,seats or something else? Where should I put these the user's records?Store these in the db.db,right?But there is not a passenger field.
thanks
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Ray,
You don't need to worry about any of that. All you should be concerned with is the integrity of the database, ie that all seats are accounted for and the db stays in a consistent state.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Ray Cheeny
Ranch Hand

Joined: Aug 21, 2002
Posts: 74
Do you mean that when the user click the booking button ,i just reduce the number of available seats
and that's enough ,right?
But,then what is the method addRecord()'s function,
for the user should not operate this .Who need use it?
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
That is all you need to do... and make sure that it works when multiple clients are booking at the same time (that's where lock/unlock comes in).
Add record is probably there because it is a normal db function, or it was used way back when Sun made the developer create the database from a text file, or they just want to confuse you Anyway, you shouldn't need to use the addRecord() method.... I have never seen anyone use it.


scwcd, scjd, scjp<br /><a href="http://natejohnson.us" target="_blank" rel="nofollow">http://natejohnson.us</a><br /><a href="http://rice.kuali.org" target="_blank" rel="nofollow">http://rice.kuali.org</a>
Ray Cheeny
Ranch Hand

Joined: Aug 21, 2002
Posts: 74
hi,
I've seen a lot about Connection factory and factory object.But I still couldn't understand it.Could somebody explain it or tell me how it works?
thanks
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Ray,
A ConnectionFactory uses a Factory pattern to issue each connecting client a unique connection. It should have a mehtod named getConnection or something similar which returns an implementation of your remote Data interface. It must itself implement Remote (thru an interface that contains the getConnection method and extends Remote) and should extend either UnicastRemoteObject or Activatable and should be bound to the RMI registry with a service name like "DBConnectionService". Your clients will connect to this service thru Naming and call getConnection to get your remote Data interface.
The remote implementations will not be bound to the RMI registry.
If you don't use a factory and just bind a remote Data implementation to the registry, you create a bottleneck since all clients will have to share the same object for database operations.
Hope this helps,
Michael Morris
 
jQuery in Action, 2nd edition
 
subject: Should we store the msg about passenger ?
 
Similar Threads
Urgent, please help, reading remote Data
Unique Scanner Problem
Collaboration
hibernate : child changes but parent doesnt know
Hash Table, Hash Map, Linked List of objects