Class PgUtils
java.lang.Object
io.openems.backend.metadata.odoo.postgres.PgUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ZonedDateTime
Return the Field of the ResultSet.static ZonedDateTime
getAsDateOrElse
(ResultSet rs, Field field, ZonedDateTime other) Return the Field of the ResultSet; or default value on error.static int
Return the Field of the ResultSet.static Integer
getAsIntegerOrElse
(ResultSet rs, Field field, Integer other) Return the Field of the ResultSet; or default value on error.static String
getAsString
(ResultSet rs, Field field) Return the Field of the ResultSet.static String
getAsStringOrElse
(ResultSet rs, Field field, String other) Return the Field of the ResultSet; or default value on error.
-
Constructor Details
-
PgUtils
public PgUtils()
-
-
Method Details
-
getAsString
Return the Field of the ResultSet.- Parameters:
rs
- the ResultSetfield
- the EdgeDevice- Returns:
- the value as String
- Throws:
SQLException
- on errorOpenemsException
- on null
-
getAsStringOrElse
Return the Field of the ResultSet; or default value on error.- Parameters:
rs
- the ResultSetfield
- the EdgeDevice fieldother
- the default value- Returns:
- the value as String
-
getAsInt
Return the Field of the ResultSet.- Parameters:
rs
- the ResultSetfield
- the EdgeDevice- Returns:
- the value as Integer
- Throws:
SQLException
- on error
-
getAsIntegerOrElse
Return the Field of the ResultSet; or default value on error.- Parameters:
rs
- the ResultSetfield
- the EdgeDevice fieldother
- 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 ResultSetfield
- the EdgeDevice field- Returns:
- the value as ZonedDateTime
- Throws:
SQLException
- SQL-ErrorOpenemsException
- OpenEMS-Error
-
getAsDateOrElse
Return the Field of the ResultSet; or default value on error.- Parameters:
rs
- the ResultSetfield
- the EdgeDevice fieldother
- the default value- Returns:
- the value as ZonedDateTime
-