The com.informix.lang.IntervalYM class allows you to manipulate year-month intervals.
The default constructor is defined as follows:
public IntervalYM() throws SQLException
Use this second version of the constructor to display localized error messages if an exception is thrown:
public IntervalYM(Connection conn) throws SQLException
Use the following constructors to create year-month intervals from specific input values:
public IntervalYM(Timestamp t1, Timestamp t2) throws SQLException public IntervalYM (Timestamp t1, Timestamp t2, Connection conn) throws SQLException
The second version allows you to support localized error messages.
public IntervalYM(int years, int months) throws SQLException public IntervalYM(int years, int months, Connection conn) throws SQLException
The second version allows you to support localized error messages.
public IntervalYM(int months, short qualifier, Connection conn) throws SQLException
To specify the qualifier, you can use the getQualifier() method described in Using Interval Methods. This constructor supports localized error messages.
public IntervalYM(String string) throws SQLException public IntervalYM(String string, Connection conn) throws SQLException
The second version allows you to support localized error messages.
public IntervalYM(String string, short qualifier, Connection conn) throws SQLException
To specify the qualifier, you can use the getQualifier() method described in Using Interval Methods. This constructor supports localized error messages.
public IntervalYM(String string, int length, byte startCode, byte endCode) throws SQLException public IntervalYM(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 year-month intervals. (You can also use the Interval methods, described previously.) Some of the tasks you can perform using IntervalYM methods include the following:
boolean equals(Object other) boolean greaterThan(IntervalYM other) boolean lessThan(IntervalYM other)
void setQualifier(int length, byte startcode, byte endcode)
void setQualifier(short qualifier)
long getMonths()
String toString()
The fields present depend on the qualifier. Blanks replace leading zeros.