|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hsqldb.lib.HsqlDateTime
collection of static methods to convert Date, Time and Timestamp strings into corresponding Java objects. Also accepts SQL literals such as NOW, TODAY as valid strings and returns the current date / time / datetime. Compatible with jdk 1.1.x
Constructor Summary | |
HsqlDateTime()
|
Method Summary | |
static java.sql.Date |
dateValue(java.lang.String s)
Converts a string in JDBC date escape format to a Date
value. |
static java.sql.Date |
getDate(java.lang.String dateString,
java.util.Calendar cal)
|
static java.lang.String |
getDateString(java.sql.Date x,
java.util.Calendar cal)
|
static java.sql.Time |
getTime(java.lang.String timeString,
java.util.Calendar cal)
|
static java.sql.Timestamp |
getTimestamp(java.lang.String dateString,
java.util.Calendar cal)
|
static java.lang.String |
getTimestampString(java.sql.Timestamp x,
java.util.Calendar cal)
|
static java.lang.String |
getTimeString(java.sql.Time x,
java.util.Calendar cal)
|
static java.sql.Timestamp |
timestampValue(long time,
int nano)
|
static java.sql.Timestamp |
timestampValue(java.lang.String s)
Converts a string in JDBC timestamp escape format to a Timestamp value. |
static java.sql.Time |
timeValue(java.lang.String s)
Converts a string in JDBC date escape format to a Time value. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HsqlDateTime()
Method Detail |
public static java.sql.Timestamp timestampValue(java.lang.String s)
Timestamp
value.
s
- timestamp in format yyyy-mm-dd hh:mm:ss.fffffffff
where end part can be omitted, or "NOW" (case insensitive)
Timestamp
value
java.lang.IllegalArgumentException
- if the given argument
does not have the format yyyy-mm-dd hh:mm:ss.fffffffff
public static java.sql.Timestamp timestampValue(long time, int nano)
time
- millisecondsnano
- nanoseconds
public static java.sql.Date dateValue(java.lang.String s)
Date
value. Also accepts Timestamp values.
s
- date in format yyyy-mm-dd
,
'TODAY', 'NOW', 'CURRENT_DATE', 'SYSDATE' (case independent)
Date
value
java.lang.IllegalArgumentException
- if the given argument
does not have the format yyyy-mm-dd
public static java.sql.Time timeValue(java.lang.String s)
Time
value.
s
- date in format hh:mm:ss
'CURRENT_TIME' or 'NOW' (case independent)
Time
value
java.lang.IllegalArgumentException
- if the given argument
does not have the format hh:mm:ss
public static java.sql.Date getDate(java.lang.String dateString, java.util.Calendar cal) throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Time getTime(java.lang.String timeString, java.util.Calendar cal) throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Timestamp getTimestamp(java.lang.String dateString, java.util.Calendar cal) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getTimestampString(java.sql.Timestamp x, java.util.Calendar cal) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getTimeString(java.sql.Time x, java.util.Calendar cal) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getDateString(java.sql.Date x, java.util.Calendar cal) throws java.sql.SQLException
java.sql.SQLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |