• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read method

 
mohini lalwani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I implemented read method and returned String[] .
String[] has record number,subcontractor name,location,specialties,size
,rate and owner
.

I am returning record number also .Is it okay or should I return
subcontractor name,location,specialties,size
,rate and owner only ???

Please reply .
Thanks
 
Alecsandru Cocarla
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion, you should return only what is in the database. you already have the record number when calling read() so it's superfluous in the result.

Also, the find() method's javadoc probably goes something like "field[n] matches criteria[n]". Again, in my opinion, criteria[n] should not contain the record number (otherwise it's just a kind of read()), so the record itself should not contain the record number.
 
mohamed sulibi
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all;
also iam with you Alecsandru Cocarla; i implemented my read and find as you noted but also for pramod karnani, you can do that as you will documents it and reflect it in all code and classes in you project in a stable and consistent ways.

regards.
SCJP, SCJD in progress ....
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I returned only the record's field. The record number is used for presentation use only in the JTable.


Good Luck !!!

Jeffry Kristianto Yanuar (Java Instructor)
SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic