Class CalendarHelper
- java.lang.Object
-
- com.ibm.fhir.database.utils.common.CalendarHelper
-
public class CalendarHelper extends java.lang.Object
Helper for time and calendar-related functions related to JDBC statements and results
-
-
Constructor Summary
Constructors Constructor Description CalendarHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Calendar
getCalendarForUTC()
Get a thread-specific instance of a calendar configured for UTC.static java.sql.Timestamp
getTimestampUTC(java.sql.ResultSet rs, int col)
Helper to obtain a UTC timestamp from a JDBCResultSet
static void
setTimestampUTC(java.sql.PreparedStatement ps, int col, java.sql.Timestamp ts)
Helper to set a UTC timestamp value in a JDBCPreparedStatement
Supports null handling for ts.
-
-
-
Method Detail
-
getCalendarForUTC
public static java.util.Calendar getCalendarForUTC()
Get a thread-specific instance of a calendar configured for UTC.- Returns:
-
getTimestampUTC
public static java.sql.Timestamp getTimestampUTC(java.sql.ResultSet rs, int col) throws java.sql.SQLException
Helper to obtain a UTC timestamp from a JDBCResultSet
- Parameters:
rs
-col
-- Returns:
- Throws:
java.sql.SQLException
-
setTimestampUTC
public static void setTimestampUTC(java.sql.PreparedStatement ps, int col, java.sql.Timestamp ts) throws java.sql.SQLException
Helper to set a UTC timestamp value in a JDBCPreparedStatement
Supports null handling for ts.- Parameters:
ps
-col
-ts
-- Throws:
java.sql.SQLException
-
-