Java Utililty Methods SQL Date from Util Date

List of utility methods to do SQL Date from Util Date

Description

The list of methods to do SQL Date from Util Date are organized into topic(s).

Method

java.sql.DategetSQLDate(final Date oDate)
get SQL Date
if (null == oDate) {
    return null;
final Calendar c = Calendar.getInstance();
c.setTime(oDate);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
...
java.sql.DategetSqlDate(java.util.Date utilDate)
converts a java.util.Date to java.sql.Date
return new java.sql.Date(utilDate.getTime());
StringgetSqlDateDefaultFormat(java.sql.Date date)
get Sql Date Default Format
String str = null;
try {
    if (date != null)
        str = date.toString();
} catch (Exception e) {
return str;
java.sql.DategetSqlDateFromDateNumber(short dateNumber)
get Sql Date From Date Number
return new java.sql.Date(dateNumber * (1000L * 60 * 60 * 24));