• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Should we store the msg about passenger ?

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ray Cheeny
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ray Cheeny
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic