Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where to place RecNo?

 
Stef Widmer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
When I read records from the database, there might be deleted ones which should not be displayed in the GUI. So I have for example Record 1, 2,3, and 5 (because number 4 is marked as deleted) read from the database and sent to the client GUI. In the JTable on the GUI side, four records are displayed. If I book the fourth record (number 5 in the DB) I need to know the record number. So I guess I have to add the "real" record number to the array of Strings e.g. in the find methode. Is this a good approach or is there a better one?

I'm not shure becuase the Array of strings is not just containing the record fields and I don't know if this is OK with the interface DBMain.
Thanks for all hints...
Stef
 
Steven Hoodless
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stef,

I'd say you do need to pass a record number. Your process needs to know that when the user clicks on the 4th record on screen he/she is actually selecting record 23 in the database for booking.

Steven
 
Robert Konigsberg
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I did was not pass string[] to the client, but rather:

class Record
{
String[] _data;
int _recordNumber;
}

That way the String[] has its meaningful representation, and so does both Record and _recordNumber.

RK
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic