Class 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 JDBC ResultSet
      static void setTimestampUTC​(java.sql.PreparedStatement ps, int col, java.sql.Timestamp ts)
      Helper to set a UTC timestamp value in a JDBC PreparedStatement Supports null handling for ts.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CalendarHelper

        public CalendarHelper()
    • 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 JDBC ResultSet
        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 JDBC PreparedStatement Supports null handling for ts.
        Parameters:
        ps -
        col -
        ts -
        Throws:
        java.sql.SQLException