This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S Find in .db or in memory?

 
Julio Cesar Marques
Ranch Hand
Posts: 80
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone!

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.
 
Roel De Nijs
Sheriff
Posts: 9838
103
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Julio Cesar Marques wrote:Hi Everyone!

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)
 
Julio Cesar Marques
Ranch Hand
Posts: 80
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Tanks buddy!

So in first Load my DataModel is Empty?
And when i create a new rec? i put it in empty data model or do anything (popup a sucess msg maybe)?
 
Roel De Nijs
Sheriff
Posts: 9838
103
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 80
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Best Regards!!
 
Roel De Nijs
Sheriff
Posts: 9838
103
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)

Kind regards,
Roel
 
Julio Cesar Marques
Ranch Hand
Posts: 80
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the point!!
Thanks man!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic