This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes How Does it Work RowMapper Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "How Does it Work RowMapper" Watch "How Does it Work RowMapper" New topic

How Does it Work RowMapper

sushi kumar

Joined: Oct 17, 2008
Posts: 2
I wanted to know when is the mapRow Method is been called.

Starts Here////

List userList=login.getLogindataList(bean.getUserName().trim(),encpassword);

public class ListRowMapper implements RowMapper
public Object mapRow(ResultSet rs, int rowNum) throws SQLException
Loginbean data = new Loginbean(rs.getInt(1),rs.getString(2));
return data;



//////////////////////// Method //////////////

public List getLogindataList(String username,String password)
Object parms[]={username.toUpperCase(),password};
List noOfUsers = _jdbcTemplate.query("Select user_no,user_type from email.admin_user_master where upper(user_id) = ? and password = ?",parms, new ListRowMapper());
return noOfUsers;
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

The JdbcTemplate hides the normal regular plumbing code of jdbc. After the query is run a ResultSet is returned. In the JdbcTemplate, it will loop through the ResultSet and get a row, it will pass that row to the RowMapper class via the mapRow() method, along with which record number it is in the ResultSet.

That is all, it is called right after the query is run.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
subject: How Does it Work RowMapper
Similar Threads
Can't declare a Sybase Cursor for StoredProcedures using Spring
better option JdbcTemplate.queryForList(query)
how can I use LIKE expression on JdbcTemplate?
JDBC from Spring framework
Can't resolve errors in Java / Spring / Oracle application, trying to add a new screen