me.icymint.libra.jdbc.result.ScalarResult 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
*
* @param
* 只返回一条查询记录。
*/
public class ScalarResult extends AbstractResult {
public ScalarResult(ResultMap rm) {
super(rm);
}
@Override
public T handle(ResultSet rs) {
try {
if (rs.next()) {
return this.handle(rs, 1);
}
return null;
} catch (SQLException e) {
throw new JdbcAccessException(e);
}
}
}