• Post Reply Bookmark Topic Watch Topic
  • New Topic

Easy way to returning ResultSets

 
Alex Yip
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm quite new to Java. I'm writing a web application, is there a way to return a ResultSet to the view without all the boring typing of creating a DTO or JavaBean? I read that was the most popular way. But what if you had to return a table of 20-30 columns? Isn't that quite a bit of typing? Or if you had to change your tables, then you would have to change the DTO/JavaBean.
 
David Peterson
author
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the iBATIS Data Mapper. I've found it very easy to use. One of the things it can do is return results as a list of Map objects (field-names mapped to values), so you don't have to create specialised beans for each type of result.
 
Alex Yip
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David. I'll go and check it out.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!