The com.informix.lang.Interval class is an Informix-specific extension to the JDBC specification from Sun Microsystems. Interval is the base class for the INTERVAL data type. Interval has two subclasses: IntervalYM (for year-month qualifiers) and IntervalDF (for day-time qualifiers). You use these subclasses to create and manipulate INTERVAL data types.
For information about the string INTERVAL formats in this section, refer to the IBM Informix: Guide to SQL Syntax.
This section discusses many of the methods you can use with the INTERVAL data types. For complete reference information, see the online reference documentation in the directory doc/javadoc/* after you install your software. (The doc directory is a subdirectory of the directory where you installed IBM Informix JDBC Driver.)
You can use string qualifiers to manipulate INTERVAL data types, but using binary qualifiers results in faster performance. The following variables are defined in the Interval base class and represent the time unit (start and end code) of a field in the binary qualifier. To use these variables, instantiate objects of the IntervalYM and IntervalDF classes, which inherit these variables from the Interval base class.
You can use the Interval methods to extract information about binary qualifiers. To use these methods, instantiate objects of the IntervalYM and IntervalDF classes, which inherit these variables from the Interval base class.
Some of the tasks you can perform and the methods you can use follow:
public static byte getLength(short qualifier)
public static byte getStartCode(short qualifier)
public static byte getEndCode(short qualifier)
public static String getFieldName(byte code)
public static String getIfxTypeName(int type, short qualifier)
public static byte getScale(short qualifier)
public static short getQualifier(byte length, byte startCode, byte endCode) throws SQLException
For example, getQualifier(4, TU_YEAR, TU_MONTH) creates a binary representation of the YEAR TO MONTH qualifier.