Here you can find the source of getArray(ResultSet rs, int index)
@SuppressWarnings("unchecked") public static <T> List<T> getArray(ResultSet rs, int index) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.Array; import java.sql.ResultSet; import java.sql.SQLException; import java.util.LinkedList; import java.util.List; import java.util.function.Function; public class Main { @SuppressWarnings("unchecked") public static <T> List<T> getArray(ResultSet rs, int index) throws SQLException { List<T> ret = new LinkedList<T>(); Array value = rs.getArray(index); if (value != null) { for (T e : (T[]) value.getArray()) { ret.add(e);// w ww . ja v a2 s . com } } return ret; } @SuppressWarnings("unchecked") public static <T, U> List<U> getArray(ResultSet rs, int index, Function<T, U> mapper) throws SQLException { List<U> ret = new LinkedList<U>(); Array value = rs.getArray(index); if (value != null) { for (T e : (T[]) value.getArray()) { ret.add(mapper.apply(e)); } } return ret; } }