Here you can find the source of getArrayAsSet(ResultSet rs, String columnLabel)
Parameter | Description |
---|---|
rs | the result set. |
columnLabel | the column label. |
public static Set<String> getArrayAsSet(ResultSet rs, String columnLabel) throws SQLException
//package com.java2s; import java.sql.Array; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Set; import com.google.common.collect.Sets; public class Main { /**/*from www .j ava 2 s.c o m*/ * Returns a string set for the given result set and column. Assumes * that the SQL type is an array of text values. * * @param rs the result set. * @param columnLabel the column label. * @return a string set. */ public static Set<String> getArrayAsSet(ResultSet rs, String columnLabel) throws SQLException { Array sqlArray = rs.getArray(columnLabel); String[] array = (String[]) sqlArray.getArray(); return Sets.newHashSet(array); } }