java.lang.Object
io.openems.backend.metadata.odoo.postgres.PgUtils

public class PgUtils extends Object
  • Constructor Details

    • PgUtils

      public PgUtils()
  • Method Details

    • getAsString

      public static String getAsString(ResultSet rs, Field field) throws SQLException, OpenemsException
      Return the Field of the ResultSet.
      Parameters:
      rs - the ResultSet
      field - the EdgeDevice
      Returns:
      the value as String
      Throws:
      SQLException - on error
      OpenemsException - on null
    • getAsStringOrElse

      public static String getAsStringOrElse(ResultSet rs, Field field, String other)
      Return the Field of the ResultSet; or default value on error.
      Parameters:
      rs - the ResultSet
      field - the EdgeDevice field
      other - the default value
      Returns:
      the value as String
    • getAsInt

      public static int getAsInt(ResultSet rs, Field field) throws SQLException
      Return the Field of the ResultSet.
      Parameters:
      rs - the ResultSet
      field - the EdgeDevice
      Returns:
      the value as Integer
      Throws:
      SQLException - on error
    • getAsIntegerOrElse

      public static Integer getAsIntegerOrElse(ResultSet rs, Field field, Integer other)
      Return the Field of the ResultSet; or default value on error.
      Parameters:
      rs - the ResultSet
      field - the EdgeDevice field
      other - the default value
      Returns:
      the value as Integer
    • getAsDate

      public static ZonedDateTime getAsDate(ResultSet rs, Field field) throws SQLException, OpenemsException
      Return the Field of the ResultSet.
      Parameters:
      rs - the ResultSet
      field - the EdgeDevice field
      Returns:
      the value as ZonedDateTime
      Throws:
      SQLException - SQL-Error
      OpenemsException - OpenEMS-Error
    • getAsDateOrElse

      public static ZonedDateTime getAsDateOrElse(ResultSet rs, Field field, ZonedDateTime other)
      Return the Field of the ResultSet; or default value on error.
      Parameters:
      rs - the ResultSet
      field - the EdgeDevice field
      other - the default value
      Returns:
      the value as ZonedDateTime