Here you can find the source of getArray(ResultSet rs, String columnName, Class extends T[]> cls)
public static <T> T[] getArray(ResultSet rs, String columnName, Class<? extends T[]> cls) 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.Arrays; public class Main { public static <T> T[] getArray(ResultSet rs, String columnName, Class<? extends T[]> cls) throws SQLException { return getArray(rs, columnName, cls, null); }//from w w w.java 2s.c o m public static <T> T[] getArray(ResultSet rs, String columnName, Class<? extends T[]> cls, T[] ifNull) throws SQLException { Array array = rs.getArray(columnName); if (array != null) { Object[] objects = (Object[]) array.getArray(); return Arrays.copyOf(objects, objects.length, cls); } else { return ifNull; } } }