|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.informix.lang.Interval
com.informix.lang.IntervalDF
This class represents day-to-fraction INTERVAL SQL data types in Java. This class was created because the Sun JDBC specification did not include such a class.
Timestamp
Field Summary |
Fields inherited from class com.informix.lang.Interval |
TU_DAY, TU_F1, TU_F2, TU_F3, TU_F4, TU_F5, TU_FRAC, TU_HOUR, TU_MINUTE, TU_MONTH, TU_SECOND, TU_YEAR |
Constructor Summary | |
IntervalDF()
Default Constructor with the default qualifier set to: leading field precision: 2 start code: TU_DAY end code: TU_F5 |
|
IntervalDF(java.sql.Connection conn)
Default Constructor with the default qualifier set to: leading field precision: 2 start code: TU_DAY end code: TU_F5 This constructor allows you to display localized error messages if an exception is thrown. |
|
IntervalDF(long seconds,
long nanos)
Creates an Interval from a number of seconds and nanoseconds. |
|
IntervalDF(long seconds,
long nanos,
java.sql.Connection conn)
Creates an Interval from a number of seconds and nanoseconds. |
|
IntervalDF(long seconds,
long nanos,
short qual)
Creates an Interval from a number of seconds, number of nanoseconds, and qualifier. |
|
IntervalDF(long seconds,
long nanos,
short qual,
java.sql.Connection conn)
Creates an Interval from a number of seconds, number of nanoseconds, and qualifier. |
|
IntervalDF(java.lang.String str)
Creates an Interval from a string and the default qualifier is set to: leading field precision: 2 start code: TU_DAY end code: TU_F5 |
|
IntervalDF(java.lang.String str,
java.sql.Connection conn)
Creates an Interval from a string and the default qualifier is set to: leading field precision: 2 start code: TU_DAY end code: TU_F5 This constructor supports localized error messages. |
|
IntervalDF(java.lang.String str,
int len,
byte startCode,
byte endCode)
Creates an Interval from a string and qualifier information. |
|
IntervalDF(java.lang.String str,
int len,
byte startCode,
byte endCode,
java.sql.Connection conn)
Creates an Interval from a string and qualifier information. |
|
IntervalDF(java.lang.String str,
short qual)
Creates an Interval from a string and the qualifier. |
|
IntervalDF(java.lang.String str,
short qual,
java.sql.Connection conn)
Creates an Interval from a string and the qualifier. |
|
IntervalDF(java.sql.Timestamp t1,
java.sql.Timestamp t2)
Creates an Interval object from two timestamps. |
|
IntervalDF(java.sql.Timestamp t1,
java.sql.Timestamp t2,
java.sql.Connection conn)
Creates an Interval object from two timestamps. |
Method Summary | |
boolean |
equals(java.lang.Object other)
Compares two Intervals for equality. |
void |
fromString(java.lang.String str)
Sets the values for the Interval from a string. |
long |
getNanoSeconds()
Returns the number of nanoseconds in the Interval. |
long |
getSeconds()
Returns the number of seconds in the Interval. |
boolean |
greaterThan(IntervalDF other)
Compares this Interval with another to see if it is greater (longer in time) than the other. |
boolean |
lessThan(IntervalDF other)
Compares this Interval with another to see if it is less (shorter in time) than the other. |
void |
set(long seconds,
long nanos)
Sets the value of the Interval from specified second and nanosecond values. |
void |
set(java.lang.String str)
Sets the value of the Interval from a specified string. |
void |
set(java.sql.Timestamp t1,
java.sql.Timestamp t2)
Sets the value of the Interval from the difference between two timestamps. |
void |
setQualifier(byte len,
byte startCode,
byte endCode)
Sets the qualifier from its constituent pieces. |
void |
setQualifier(short qualifier)
Sets the qualifier using an existing qualifier. |
java.lang.String |
toString()
Creates a string representation of the interval in the following format: ddddd hh:mm:ss.nano The presence of the various fields depends upon the qualifier. |
Methods inherited from class com.informix.lang.Interval |
getEndCode, getEndCode, getFieldName, getIfxTypeName, getLength, getQualifier, getQualifier, getScale, getStartCode, getStartCode, getStaticEndCode, getStaticStartCode, goodQualifier, setConnection |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public IntervalDF() throws java.sql.SQLException
java.sql.SQLException
public IntervalDF(java.sql.Connection conn) throws java.sql.SQLException
conn
- Connection object
java.sql.SQLException
public IntervalDF(java.sql.Timestamp t1, java.sql.Timestamp t2) throws java.sql.SQLException
t1
- First timestamp.t2
- Second timestamp.
java.sql.SQLException
public IntervalDF(java.sql.Timestamp t1, java.sql.Timestamp t2, java.sql.Connection conn) throws java.sql.SQLException
t1
- First timestamp.t2
- Second timestamp.conn
- Connection object.
java.sql.SQLException
public IntervalDF(long seconds, long nanos) throws java.sql.SQLException
seconds
- Number of seconds in the interval.nanos
- Number of nanoseconds in the interval.
java.sql.SQLException
public IntervalDF(long seconds, long nanos, java.sql.Connection conn) throws java.sql.SQLException
seconds
- Number of seconds in the interval.nanos
- Number of nanoseconds in the interval.conn
- Connection object
java.sql.SQLException
public IntervalDF(long seconds, long nanos, short qual) throws java.sql.SQLException
seconds
- Number of seconds in the interval.nanos
- Number of nanoseconds in the interval.qual
- Interval qualifier value.
java.sql.SQLException
public IntervalDF(long seconds, long nanos, short qual, java.sql.Connection conn) throws java.sql.SQLException
seconds
- Number of seconds in the interval.nanos
- Number of nanoseconds in the interval.qual
- Interval qualifier value.conn
- Connection object
java.sql.SQLException
public IntervalDF(java.lang.String str) throws java.sql.SQLException
str
- String Interval value.
java.sql.SQLException
public IntervalDF(java.lang.String str, java.sql.Connection conn) throws java.sql.SQLException
str
- String Interval value.conn
- Connection object
java.sql.SQLException
public IntervalDF(java.lang.String str, short qual) throws java.sql.SQLException
str
- String Interval value.qual
- Interval qualifier value.
java.sql.SQLException
public IntervalDF(java.lang.String str, short qual, java.sql.Connection conn) throws java.sql.SQLException
str
- String Interval value.qual
- Interval qualifier value.conn
- Connection object
java.sql.SQLException
public IntervalDF(java.lang.String str, int len, byte startCode, byte endCode) throws java.sql.SQLException
str
- The string representation of the day to fraction Interval.len
- The total length of the qualifier fields.startCode
- The starting time unit value (TU_XXX).endCode
- The ending time unit value (TU_XXX).
java.sql.SQLException
public IntervalDF(java.lang.String str, int len, byte startCode, byte endCode, java.sql.Connection conn) throws java.sql.SQLException
str
- The string representation of the day to fraction Interval.len
- The total length of the qualifier fields.startCode
- The starting time unit value (TU_XXX).endCode
- The ending time unit value (TU_XXX).conn
- Connection object
java.sql.SQLException
Method Detail |
public void set(java.sql.Timestamp t1, java.sql.Timestamp t2)
t1
- First timestamp.t2
- Second timestamp.public void set(long seconds, long nanos)
seconds
- Number of seconds in the interval.nanos
- Number of nanoseconds in the interval.public void set(java.lang.String str) throws java.sql.SQLException
str
- A valid string representing a day to fraction INTERVAL.
java.sql.SQLException
public java.lang.String toString()
public void fromString(java.lang.String str) throws java.sql.SQLException
str
- String in ddddd hh:mm:ss.nano format.
java.sql.SQLException
public long getSeconds()
public long getNanoSeconds()
public boolean equals(java.lang.Object other)
other
- The Interval to which this Interval is compared.
public boolean greaterThan(IntervalDF other)
other
- The Interval to which this Interval is compared.
public boolean lessThan(IntervalDF other)
other
- The Interval to which this Interval is compared.
public void setQualifier(byte len, byte startCode, byte endCode) throws java.sql.SQLException
len
- The total length of the qualifier fields.startCode
- The starting time unit value (TU_XXX).endCode
- The ending time unit value (TU_XXX).
java.sql.SQLException
public void setQualifier(short qualifier) throws java.sql.SQLException
qualifier
- The qualifier value.
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |