Here you can find the source of toSingleResult(ResultSet rs)
public static Object toSingleResult(ResultSet rs)
//package com.java2s; //License from project: Apache License import java.sql.ResultSet; public class Main { public static Object toSingleResult(ResultSet rs) { Object result = null;/*from w ww. jav a2s . c o m*/ try { while (rs.next()) { result = rs.getObject(1); break; } } catch (Exception e) { throw new RuntimeException(e.getMessage()); } return result; } }