The com.ibm.db2.jcc.DBTimestamp class can be used to create timestamp objects with a precision of up to picoseconds and time zone information. This class is primarily for support of the SQL TIMESTAMP WITH TIME ZONE data type, which is supported only by DB2® for z/OS®.
The com.ibm.db2.jcc.DBTimestamp class is a subclass of the java.sql.Timestamp class. Therefore, a com.ibm.db2.jcc.DBTimestamp object can be used with any methods that normally operate on a java.sql.Timestamp object, or take a java.sql.Timestamp object as an argument.
The IBM® Data Server Driver for JDBC and SQLJ returns a DBTimestamp object for all JDBC methods that return timestamp information, such as ResultSet.getTimestamp or CallableStatement.getTimestamp.
The following constructor is defined only for the IBM Data Server Driver for JDBC and SQLJ.
public DBTimestamp(long time,
java.util.Calendar calendar)
throws java.sql.SQLException
public DBTimestamp(long time)
throws java.sql.SQLException
public DBTimestamp(java.sql.Timestamp timestamp)
throws java.sql.SQLException
public DBTimestamp(java.sql.Timestamp timestamp,
java.util.Calendar calendar)
throws java.sql.SQLException
Constructs a DBTimestamp object.
public long getPicos()
Returns the fractional seconds component of a DBTimestamp value.
public java.util.TimeZone getTimeZone()
Returns the time zone component of a DBTimestamp value.
public void setPicos(long p)
throws SQLException
Assigns the given value to the fractional seconds component of a DBTimestamp value.
public void setTimeZone(java.util.TimeZone timeZone)
throws SQLException
Assigns the given value to the time zone component of a DBTimestamp value.
public static DBTimestamp valueOfDBString(String s)
throws java.lang.IllegalArgumentException
Constructs a DBTimestamp value from the string representation of a timestamp value.
yyyy-mm-dd.hh.mm.ss[.ffffffffffff]-th:tm
yyyy-mm-dd hh:mm:ss[.ffffffffffff]-th:tm
yyyy-mm-dd.hh.mm.ss[.ffffffffffff]
yyyy-mm-dd hh:mm:ss[.ffffffffffff]
public String toDBString(boolean includeTimeZone)
Returns the string representation of a DBTimestamp object.
The returned value has one of the following formats:
yyyy-mm-dd.hh.mm.ss[.ffffffffffff]-th:tm
yyyy-mm-dd.hh.mm.ss[.ffffffffffff]