Java examples for java.sql:ResultSet
get Value From ResultSet
//package com.java2s; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static Object getValueFromRs(ResultSet rs, String columnName) { Object val = null; try {/*from w ww . ja v a 2 s. co m*/ val = rs.getObject(columnName); if ("".equals(val)) { val = null; } } catch (SQLException sqle) { val = null; } return val; } }