Package io.github.connellite.jdbc
Class ArrayUtils
java.lang.Object
io.github.connellite.jdbc.ArrayUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArraytoArray(Connection connection, String typeName, Object[] elements) Creates a JDBCArrayfrom an object array.static ArraytoArray(Connection connection, String typeName, Collection<?> elements) Creates a JDBCArrayfrom aCollection.
-
Constructor Details
-
ArrayUtils
public ArrayUtils()
-
-
Method Details
-
toArray
public static Array toArray(Connection connection, String typeName, Object[] elements) throws SQLException Creates a JDBCArrayfrom an object array.- Parameters:
connection- open JDBC connection used to create array instancestypeName- database-specific SQL array element type name (for example,varchar)elements- source elements;nullis treated as an empty array- Returns:
- JDBC
Arraycreated byConnection.createArrayOf(String, Object[]) - Throws:
SQLException
-
toArray
public static Array toArray(Connection connection, String typeName, Collection<?> elements) throws SQLException Creates a JDBCArrayfrom aCollection.- Parameters:
connection- open JDBC connection used to create array instancestypeName- database-specific SQL array element type name (for example,varchar)elements- source elements;nullis treated as an empty collection- Returns:
- JDBC
Arraycreated byConnection.createArrayOf(String, Object[]) - Throws:
SQLException
-