Look for solutions not problems!
Jason Marshall wrote:I am up to the stage in my project where I need to add a new record.
Jason Marshall wrote:How do I open a new JPanel that exists within the same JFrame?
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Look for solutions not problems!
K. Tsang wrote:
Jason Marshall wrote:How do I open a new JPanel that exists within the same JFrame?
Hi Jason, how are you doing book or search? Are you using internal frame (like you are currently) or popup frame/dialog?
The idea should be the same. Creating or delete records is the least worry of the GUI. Searching and booking (updating) are the key requirements you must implement.
Look for solutions not problems!
Roel De Nijs wrote:Hi Jason,
I have implemented all methods from DBAccess (and even some own methods I needed) in my Data class: so I have in my Data class a create- (reusing deleted entries), update-, delete-, read-, find-, isLocked-, lock- and unlock-method.
I only used these methods in my program: find (look for rooms), read (read the rooms), update + isLocked + lock + unlock (book a room). So create- and delete-method are unused.
If you want to test your methods (see if implementation is ok and they act like they should) I would create a test-case (or test-program, something like Junit, TestNG). I even suggest this for all your methods, certainly for your Data class (it's the most important class you will create). I created a Data class test with 100% coverage (so each situation is tested, also those when you pass a wrong/illegal parameter). I have a 68 different tests (for just 11 methods ). The benefit of this approach: if you make some changes after a week to your Data class, you just run your test-case and you see immediately of those changes broke your existing code. And of course running just this test-case is a lot easier and faster than starting whole your application to see if an update was successful
But you don't have to use all methods from Data. I created a second find-method (returning record numbers + record data instead of just record numbers). And in my program I use that one instead of the one defined in Sun's interface.
[edit] don't forget to make a backup of your original database file (if you start updating, deleting,...) because you have to submit an original (unchanged) database file)
Kind regards,
Roel
Look for solutions not problems!
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
K. Tsang wrote:Hi Jason,
For your questions, ideally you just need to enter the customer ID (owner field) which is 8-digit string, not the customer name like you said. All other fields don't need to change, but if you want you can change the date to the check-in date (ie 2 days from today satisfying that 48 hour rule).
Don't worry if you worked on the assignment more than one year, I think the one-year period applies to new candidates.
Also when you do submit, you need to submit the original database file that came with your assignment (no new records, no deleted records, no changed fields).
Look for solutions not problems!
Consider Paul's rocket mass heater. |