I looking for similar question here but i not found anything so i ask:
On the startup of my app client it load all data from .db file and fill JTable (is this correct?).
And my question is: When user perform a find operation i have to search critéria in .db file and fill JTable with results or i filter data inner JTable?
Again sorry about my english.
I can tell you just what i did:
Q1: i didn't load all records at startup, because if db keeps growing it would be very slow and maybe a whole lot of the records are of no use at all. but that's your own choice to make and describe it in your choices.txt
Q2: i do a search in the db, the returned records are filtered (on exact match), the records that meet the criteria are added to the JTable, so the table stays as simple as possible (no filters, no column sorters,... just an own TableModel containing the records that match)
you may load the data at startup, it's a choice up to you
as far as i know you don't have to create records. just searching for records and booking (updating) one is required. so i didn't create any records
Julio Cesar Marques
Joined: Mar 21, 2009
Maybe we don't talking about same thing...
Ok i'll not bring data on the first load OK?
But after screen rendered to user the user click in new Button (to create a new CSR), this is about
public int create(String data) method. On create a new record in .db file i have to put this record in my local table or not?
i don't have a new-button in my gui, because it's not necessary in my assignment to create new records at the GUI (i did implement the create method from sun's interface of course).
But if i would have to add a new record, this is how i should do it:
- user hits "new" button
- application opens dialog to enter the record details
- user hits ok
- application calls the create-method of Data-class and new record is inserted in the db-file
- if it succeeds i show a message to let user know the record was added successful (because the result table show eg. results of a search on name="Roel" and user just added record with name="Julio", so it should not be in the result table in my opinion)