This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

B&S Find in .db or in memory?  RSS feed

 
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.
 
Sheriff
Posts: 11338
177
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: 11338
177
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: 11338
177
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
Boost this thread!