Here you can find the source of writeArray(Connection connection, PreparedStatement preparedStatement, int column, Class
public static <T> void writeArray(Connection connection, PreparedStatement preparedStatement, int column, Class<T> type, T[] array) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; public class Main { public static <T> void writeArray(Connection connection, PreparedStatement preparedStatement, int column, Class<T> type, T[] array) throws SQLException { if (type == String.class) { java.sql.Array sqlArray = connection.createArrayOf("VARCHAR", array); preparedStatement.setArray(column, sqlArray); } else {/*from w w w .j a v a 2 s .co m*/ throw new IllegalArgumentException("Type '" + type.getName() + "' is not supported."); } } }