Originally posted by dennis hu:
And I hava anothr question:I had seen many guis had a execute.jar file,why? and what is included in the jar file?
I think we only two jar fles:client.jar,server.jar.
Originally posted by dennis hu:
I create a model extends DefaultTableModel,it is easy to change the table data.But when there is not any flights to match the criteria,I donot know how to clear the table and show nothing,cos cannot use setDataVector(null,null).
What can i do??
It means:client can put in the invalid field name.But if used the comboBox,client cannot put in the invalid field name,is right?
And if I use the comboxes,I will invoke findCriteria(String) method to find all records in db.db file,and add the flight numbr,origin airport and destination airport in different hashset.After visited all records in db.db file,I can get the single string result in hashset and add it to comboes,but when del or add a record in db.db file,what should i do?
Those classes were always notified when a search completed and each pertinent field was added to the Set keeping it up to date. Any time a criterion was set to "ANY" and a search was performed, then the particular Set would definitely be up to date. It's not a 100% deterministic but the odds are after any particular search, then eventually there will be a search with all criteria set to ANY to reload all the flights into the table.
Don't worry about deleted records, if that happens and there are no more "SFA" origin flights available, then selecting that criterion will just result in no records being matched.
Maybe it is not up to date,why not fire a method to refresh JComboBox contents after deleted or add fligh?
I had a ServerEventService that was bound to the RMI registry along with the ConnectionFactory. It was really pretty simple to implement. You could do something similar and fire events from the server which would be sent to all registered clients whenever an addition/deletion occurred. Mine ran in a background thread on both server and client. If you want some more information about this, let me know and I'll detail how I implemented it.
Originally posted by Jeff:
After reading a lot in this forum, I guess I know how to implement the LockManager, however I and not very clear how the LockManager is called?
I designed the bookFlight on the client site and the bookFlight calls lock, read,modify,unlock. Dose this make sence?
I only update the Origin and Destination combo boxes once when the system starts up. My reasoning is that these should be updated rarely. Is this OK as long as I explain my reasoning in the choices document?
Also, is anyone going through the trouble of changing the contents of the combo boxes, such that if I select an Origin of "DAL", the only destinations that I can select in the Destination combo boxes are flights with DAL as the origin? I hope that this is not a requirement.
1: as you know,the table data in db.db file are all String type,how do you know their real data type:such as price,duration and seats.
2:I had a interface contains some static data:like
private static final int NAME=0;
If I had a String variable s="name",I want to get the String "RealName" in names array,I invoke s=s.toUppderCase(),So s="NAME",but I cannot use the method s=names[s] to get "RealName",What can I do?
3:I had a gui on server side to rebind ConnectionFactoryImpl,and no other thinds.
If I want to shut down the server but not use "CTRL+C",what command can I use?
Before I shut down the server,I must lock the database,do I need a reference in this gui?
I created a specialized class on the server to lock and shutdown the database. It had a reference to the Data object and the LockManager object. It only implemented lock() and unlock() (each of which always passed -1 to the lock manager regardless of the record parameter) and close(). So yes you will need a reference to gracefully shutdown the server.
And the server is always run,how to shut down it gracefully?