Class PgJdbcUtils

java.lang.Object
org.pgcodekeeper.core.database.pg.jdbc.PgJdbcUtils

public final class PgJdbcUtils extends Object
  • Constructor Details

    • PgJdbcUtils

      public PgJdbcUtils()
  • Method Details

    • getColArray

      public static <T> T[] getColArray(ResultSet rs, String columnName) throws SQLException
      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 data
      columnName - the name of the column containing the array
      isAllowedNull - 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 fails
      IllegalArgumentException - if the column value is null and nulls are not allowed