Results 1 to 4 of 4

Thread: ResultSet automatic mapping to JavaBean

  1. #1
    Join Date
    Dec 2005
    Posts
    12

    Default ResultSet automatic mapping to JavaBean

    Hi All,

    Is there something in Spring which can map a ResultSet to a JavaBean directly?

    What I'm looking for is somethis similar to the BeanHandler present in Apache Commons DBUtils.

    Thanks,
    Daniel

  2. #2
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    452

    Default

    Hello,

    not sure what you need exactly.

    But if you want to map the rows yourself in one place, have a look here

    Hope this helps
    regards
    agim

  3. #3
    Join Date
    Dec 2005
    Posts
    12

    Default

    Hi!

    I wanna cols to be automatically mapped to bean properties. I'm achieving this using apache commons dbutils inside spring rowmapper, like this:

    return getJdbcTemplate().query(getQuery(),
    new Object[] { nmLogin, nmLogin }, new RowMapper() {
    public Object mapRow(ResultSet rs, int i)
    throws SQLException {

    return beanHandler.handle(rs);
    }
    });

    Thanks,
    Daniel

  4. #4
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Last edited by karldmoore; Aug 29th, 2007 at 11:54 AM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

Posting Permissions

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