|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--com.sap.sql.DateTimeNormalizer
This class can be used to normalize time values that need to be stored via
JDBC. Solves the issues with java.sql.Date and
java.sql.Time: Both needs to have their millisecond values to
be normalized (i.e. the time components must be zero for
java.sql.Date and the date component must be
'1970-01-01' for java.sql.Time), but fail to do the
normalization in their constructor.
| Method Summary | |
static long |
normalizeSqlDateMillies(long milliSeconds)
Normalizes a milli second value according to the specification of java.sql.Date..
|
static long |
normalizeSqlTimeMillies(long milliSeconds)
Normalizes a milli second value according to the specification of java.sql.Time..
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final long normalizeSqlDateMillies(long milliSeconds)
java.sql.Date..
That is the hour, minute, second and millisecond fields are set to zero according to the
VMs default time zone. Typical usage is like:
java.sql.Date birthday = new java.sql.Date(normalizeSqlDateMillies(millis));
milliSeconds - the value to normalize.public static final long normalizeSqlTimeMillies(long milliSeconds)
java.sql.Time..
That is the date fields are set to 01.01.1970 according to the VMs default time zone.
Typical usage is like:
java.sql.Time noon = new java.sql.Date(normalizeSqlTimeMillies(millis));
milliSeconds - the value to normalize.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||