All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.icymint.libra.jdbc.result.ScalarResultMap Maven / Gradle / Ivy

package me.icymint.libra.jdbc.result;

import java.sql.ResultSet;
import java.sql.SQLException;

import me.icymint.libra.jdbc.JdbcAccessException;

/**
 * 标量结果,其只返回一条记录中的第一个值。
 * 
 * @author Daniel Yu
 * @since 2013-3-14
 * 
 */
public class ScalarResultMap implements ResultMap {

	@Override
	public Object handle(ResultSet rs, int index) throws JdbcAccessException {
		try {
			return rs.getObject(1);
		} catch (SQLException e) {
			throw new JdbcAccessException(e);
		}
	}

}