This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Initial display of data.

 
Olena Golub
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am still staying with the same problem with displaying the initial data into my Table after the application have been started.
I have some ideas but i am not sure what idea is correct or more reasonable.

1. Search for all records by calling the SUN-provided method find(String[] criteria) with empty criteria. It's my favorite

2. Call the SUN-provided method read(int recNo) up to that time i recieve a RecordNotFoundException.
But i think this is not a good idea, because RecordNotFoundException will be thrown when the record has a deleted flag. And this stops after the first deleted record will be found.

3. To provide one of two additional method in the DataAdaptor: getRecordCount() or getAllRecords()
But i am not sure if it is right.

How do you think what is the best way to do this? Or do you have another ideas?
I am very appreciated for you comments.

Thanks
Olena
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've implemented No 1, pretty much because you need to implement a find method which returns all results anyway. So doesn't really require any extra work.

I wouldn't have implemented option 2 due to the reasons you give.

Option 3 is do-able, I believe, as its been mentioned else where that you CAN extend the interface provided by Sun. Whether it provides an easier or cleaner implementation than option 1 is open to debate. I think some folks have implemented this option though.

Cheers,
Matt.
 
Arun Subramanian
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3. To provide one of two additional method in the DataAdaptor: getRecordCount() or getAllRecords()
But i am not sure if it is right.


I am using a "getRecordCount()" approach which is defined in my implementation of the SUN provided Data Interface. This gives my TableModel the number of rows for initial display. I also have a "getSchemaDescription()" method (again defined in the same above implementation) for storing the database file schema information and which gives my TableModel the number of columns for initial display.

Thanks,
Arun.
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Olena,

I opted for no. 1 too. Why implement another solution when you have to make the find method anyway?

Frans.
 
Olena Golub
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt, Arun and Frans thanks a lot for you comments.
I will stay with my favorit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic