wood burning stoves*
The moose likes JDBC and the fly likes Eliminate List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Eliminate List " Watch "Eliminate List " New topic

Eliminate List

Nick Davenport

Joined: Jul 27, 2007
Posts: 12
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

Joined: Jul 04, 2004
Posts: 979
If you are getting a single record of RowBean as in your code...

just return the same...
Rob Spoor

Joined: Oct 27, 2005
Posts: 19656

try-catch-finally block and closing of resources omitted for brevity.

How To Ask Questions How To Answer Questions
Nick Davenport

Joined: Jul 27, 2007
Posts: 12
Thanks it works great.

Is this an example of DTO (Data Transfer Object)?
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30146

Originally posted by Nick Davenport:
Is this an example of DTO (Data Transfer Object)?

Yes it is.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link: http://aspose.com/file-tools
subject: Eliminate List
Similar Threads
Best practice to get table form data back to Java beans
Singletons in servlets - threadsafe?
LoginBean doesn't compile
Problem with c:foreach not working
Database access, potential threading problem?