Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.rajaram.bookmark.jdbc; import com.rajaram.bookmark.constants.BookmarkSqlTableConstants; import com.rajaram.bookmark.model.Bookmark; import java.sql.ResultSet; import java.sql.SQLException; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ResultSetExtractor; /** * * @author Rajaram * @since 21-04-2014 * @version 0.1 */ public class BookmarkExtractor implements ResultSetExtractor<Bookmark> { @Override public Bookmark extractData(ResultSet resultSet) throws SQLException, DataAccessException { Bookmark bookmark = new Bookmark(); bookmark.setUrl(resultSet.getString(BookmarkSqlTableConstants.url)); bookmark.setName(resultSet.getString(BookmarkSqlTableConstants.urlName)); bookmark.setFolder(resultSet.getString(BookmarkSqlTableConstants.folderName)); return bookmark; } }