wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Where to place RecNo? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Where to place RecNo?" Watch "Where to place RecNo?" New topic
Author

Where to place RecNo?

Stef Widmer
Greenhorn

Joined: Jun 16, 2004
Posts: 17
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

Joined: Mar 23, 2004
Posts: 64
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


SCJP, SCJD, SCWCD.
Robert Konigsberg
Ranch Hand

Joined: Jun 23, 2004
Posts: 172
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


SCJP 1.4 (91%)<br />SCJD 1.4 (376/400, 94%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where to place RecNo?
 
Similar Threads
Bodgitt & Scarper - Database Record Numbering
URLyBird - Data.java
get all records in GUI in B&S
Synchronization of public methods in DVDDatabase
Records