The com.informix.lang.IntervalDF class allows you to manipulate intervals.
The default constructor is defined as follows:
public IntervalDF() throws SQLException
Use this second version of the default constructor to display localized error messages if an exception is thrown:
public IntervalDF(Connection conn) throws SQLException
Use the following constructors to create intervals from specific input values:
public IntervalDF(Timestamp t1, Timestamp t2) throws SQLException public IntervalDF(Timestamp t1, Timestamp t2, Connection conn) throws SQLException
The second version allows you to support localized error messages.
public IntervalDF(long seconds, long nanos) throws SQLException public IntervalDF(long seconds, long nanos, Connection conn) throws SQLException
The second version allows you to support localized error messages.
public IntervalDF(long seconds, long nanos, short qualifier) throws SQLException public IntervalDF(long seconds, long nanos, short qualifier, Connection conn) throws SQLException
To specify the qualifier, you can use the getQualifier() method described in Using Interval Methods. The second version allows you to support localized error messages.
public IntervalDF(String string) throws SQLException public IntervalDF(String string, Connection conn) throws SQLException
The second version allows you to support localized error messages.
When you use these constructors, the default qualifier is set to the following values:
leading field precision: 2start code: TU_DAYend code: TU_F5
For information about string INTERVAL formats, refer to the IBM Informix: Guide to SQL Syntax.
public IntervalDF(String string, short qualifier) throws SQLException public IntervalDF(String string, short qualifier, Connection conn) throws SQLException
To specify the qualifier, you can use the getQualifier() method described in Using Interval Methods. The second version allows you to support localized error messages.
public IntervalDF(String string, int length, byte startcode, byte endcode) throws SQLException public IntervalDF(String string, int length, byte startcode, byte endcode, Connection conn) throws SQLException
The second version allows you to support localized error messages.
The following methods allow you to manipulate intervals. (You can also use the Interval methods, described previously.) The tasks you can perform, and the methods you can use, are as follows:
boolean equals(Object other) boolean greaterThan(IntervalDF other) boolean lessThan(IntervalDF other)
void setQualifier(int length, byte startcode, byte endcode)
long getNanoSeconds()
long getSeconds()
String toString()
The fields present depend on the qualifier. Blanks replace leading zeros.