Class PgJdbcUtils
java.lang.Object
org.pgcodekeeper.core.database.pg.jdbc.PgJdbcUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T[]getColArray(ResultSet rs, String columnName) static <T> T[]getColArray(ResultSet rs, String columnName, boolean isAllowedNull) Retrieves an array column from the result set.
-
Constructor Details
-
PgJdbcUtils
public PgJdbcUtils()
-
-
Method Details
-
getColArray
- Throws:
SQLException
-
getColArray
public static <T> T[] getColArray(ResultSet rs, String columnName, boolean isAllowedNull) throws SQLException Retrieves an array column from the result set. Returns the array values if present, or handles null values based on the allowed null flag.- Type Parameters:
T- the array element type- Parameters:
rs- the result set containing the datacolumnName- the name of the column containing the arrayisAllowedNull- if true, returns null when column value is null; if false, throws IllegalArgumentException when column value is null- Returns:
- the array values from the specified column, or null if the column value is null and nulls are allowed
- Throws:
SQLException- if array retrieval from the result set failsIllegalArgumentException- if the column value is null and nulls are not allowed
-