Here you can find the source of getArray(ResultSet resultSet, String columnLabel, Class
public static <T> T[] getArray(ResultSet resultSet, String columnLabel, Class<T> clazz) throws SQLException
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Array; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static <T> T[] getArray(ResultSet resultSet, String columnLabel, Class<T> clazz) throws SQLException { @SuppressWarnings("unchecked") T[] array = (T[]) resultSet.getArray(columnLabel).getArray(); if (array != null) { return array; }//from ww w . j a v a 2 s. c o m @SuppressWarnings("unchecked") T[] empty = (T[]) Array.newInstance(clazz, 0); return empty; } public static <T> T[] getArray(ResultSet resultSet, int columnIndex, Class<T> clazz) throws SQLException { @SuppressWarnings("unchecked") T[] array = (T[]) resultSet.getArray(columnIndex).getArray(); if (array != null) { return array; } @SuppressWarnings("unchecked") T[] empty = (T[]) Array.newInstance(clazz, 0); return empty; } }