Results 1 to 2 of 2
  1. #1
    jeata is offline Member
    Join Date
    Oct 2010
    Posts
    33
    Rep Power
    0

    Default JDBC SQL Rows to Objects

    Hi

    I'm struggling with the following problem. When the rows from a table are returned to java, how to transform them into objects. For example I have two keys(eid, ename) and don't want them to appear as strings, I want them to appear as objects.

    Regards

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,830
    Rep Power
    19

    Default

    Iterate over the ResultSet and create an object for each row, adding it to a suitable collection (like ArrayList).

    This assumes you have written a class that represents your model (ie the data you are working with).

Similar Threads

  1. Replies: 1
    Last Post: 01-22-2009, 04:25 PM
  2. Replies: 0
    Last Post: 04-01-2008, 10:17 AM
  3. Replies: 0
    Last Post: 09-28-2007, 12:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •