• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eliminate List

 
Nick Davenport
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a class that fetches a record but dont think I need to use List object because I am fetching one record and not an array of records.
Please advise the best way to change the below class where I assume I should use something different instead of List? Maybe HashMap? Not sure how to do this?

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are getting a single record of RowBean as in your code...

just return the same...
 
Rob Spoor
Sheriff
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

try-catch-finally block and closing of resources omitted for brevity.
 
Nick Davenport
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks it works great.

Is this an example of DTO (Data Transfer Object)?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34645
363
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nick Davenport:
Is this an example of DTO (Data Transfer Object)?

Yes it is.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic