Java Utililty Methods SQL Date

List of utility methods to do SQL Date

Description

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

Method

DategetYearLater()
get Year Later
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 1);
Date date = new Date(calendar.getTimeInMillis());
return date;
StringhexToBin(String sHexString)
This method is used to convert hexcidecimal to binary string
String sBinString = "";
for (int i = 0; i < sHexString.length(); i++)
    sBinString += hexCharToBin(sHexString.charAt(i));
return sBinString;
booleanisLastDayOfMonth(String theDataStr)
is Last Day Of Month
Date theDate = java.sql.Date.valueOf(theDataStr);
Calendar c = new GregorianCalendar();
c.setTime(theDate);
int nowDay = c.get(Calendar.DAY_OF_MONTH);
c.set(Calendar.DAY_OF_MONTH, 1);
c.add(Calendar.MONTH, 1);
c.add(Calendar.DAY_OF_MONTH, -1);
int lowDayOfMonth = c.get(Calendar.DAY_OF_MONTH);
...
booleanisSimpleColumnType(Class columnType)
is Simple Column Type
return columnType.isPrimitive() || columnType.equals(String.class) || columnType.equals(Integer.class)
        || columnType.equals(Long.class) || columnType.equals(Date.class)
        || columnType.equals(java.sql.Date.class) || columnType.equals(Boolean.class)
        || columnType.equals(Float.class) || columnType.equals(Double.class)
        || columnType.equals(Byte.class) || columnType.equals(Short.class)
        || columnType.equals(CharSequence.class) || columnType.equals(Character.class);
booleanisSimpleType(Object obj)
is Simple Type
if (obj == null)
    return true;
return obj instanceof String || obj instanceof Integer || obj instanceof Long || obj instanceof Float
        || obj instanceof Double || obj instanceof Boolean || obj instanceof Locale || obj instanceof Date
        || obj instanceof Time;
java.sql.Dateissue20()
issue
return null;
java.util.Datenow()
now
return java.sql.Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant());
java.sql.DatenowPlus(int parts, int value)
convienence routine to return current time plus argument amount
Calendar now = GregorianCalendar.getInstance(utcTZ);
now.add(parts, value);
java.sql.Date sqlNow = new java.sql.Date(now.getTime().getTime());
return sqlNow;
TparseStringValue(Class returnType, String value)
Tries to parse a String into the desired object.
T objValue = null;
if (returnType == null) {
    throw new IllegalArgumentException("Parameter (Class<T> returnType) is null.");
if ((!returnType.isPrimitive()) && value == null) {
    return null;
if (char[].class.equals(returnType)) {
...
Stringserialize(Instant sourceValue)
serialize
if (sourceValue.getNano() == 0) {
    return ISO_DATE_FORMAT_SECONDS.format(sourceValue);
return ISO_DATE_FORMAT_MILLIS.format(sourceValue);