Code example for ResultSetMetaData

Methods: getColumnLabelgetColumnName

-4
	} 
 
 
	public static String lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex) throws DataAccessException {
		try{ 
			String name = resultSetMetaData.getColumnLabel(columnIndex);
			if (name == null || name.length() < 1) {
				name = resultSetMetaData.getColumnName(columnIndex);
			} 
			return name;
		}catch(SQLException e){
			throw new DataAccessException(e);
		} 
	} 
	 
 
	public static <T> T requiredSingleResult(Collection<T> results) throws DataAccessException {
		int size = (results != null ? results.size() : 0);
		if (size == 0) {
			throw new DataAccessException("EmptyResultDataAccessException");