Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hsqldb.lib
Class HsqlDateTime  view HsqlDateTime download HsqlDateTime.java

java.lang.Object
  extended byorg.hsqldb.lib.HsqlDateTime

public class HsqlDateTime
extends java.lang.Object

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

Version:
1.7.0

Field Summary
private static java.lang.String sdfdPattern
           
private static java.lang.String sdftPattern
           
private static java.text.SimpleDateFormat sdfts
           
private static java.lang.String sdftsPattern
           
 
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)
           
private static java.sql.SQLException invalidValue()
           
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sdftPattern

private static final java.lang.String sdftPattern
See Also:
Constant Field Values

sdfdPattern

private static final java.lang.String sdfdPattern
See Also:
Constant Field Values

sdftsPattern

private static final java.lang.String sdftsPattern
See Also:
Constant Field Values

sdfts

private static java.text.SimpleDateFormat sdfts
Constructor Detail

HsqlDateTime

public HsqlDateTime()
Method Detail

timestampValue

public static java.sql.Timestamp timestampValue(java.lang.String s)
Converts a string in JDBC timestamp escape format to a Timestamp value.


timestampValue

public static java.sql.Timestamp timestampValue(long time,
                                                int nano)

dateValue

public static java.sql.Date dateValue(java.lang.String s)
Converts a string in JDBC date escape format to a Date value. Also accepts Timestamp values.


timeValue

public static java.sql.Time timeValue(java.lang.String s)
Converts a string in JDBC date escape format to a Time value.


getDate

public static java.sql.Date getDate(java.lang.String dateString,
                                    java.util.Calendar cal)
                             throws java.sql.SQLException

getTime

public static java.sql.Time getTime(java.lang.String timeString,
                                    java.util.Calendar cal)
                             throws java.sql.SQLException

getTimestamp

public static java.sql.Timestamp getTimestamp(java.lang.String dateString,
                                              java.util.Calendar cal)
                                       throws java.sql.SQLException

getTimestampString

public static java.lang.String getTimestampString(java.sql.Timestamp x,
                                                  java.util.Calendar cal)
                                           throws java.sql.SQLException

getTimeString

public static java.lang.String getTimeString(java.sql.Time x,
                                             java.util.Calendar cal)
                                      throws java.sql.SQLException

getDateString

public static java.lang.String getDateString(java.sql.Date x,
                                             java.util.Calendar cal)
                                      throws java.sql.SQLException

invalidValue

private static java.sql.SQLException invalidValue()