List of utility methods to do SQL Date From
java.sql.Date | toSqlDate(String dateStr, String format) to Sql Date DateFormat dateFormat = new SimpleDateFormat(format); dateFormat.setLenient(false); Date date = dateFormat.parse(dateStr); return new java.sql.Date(date.getTime()); |
java.sql.Date | toSQLDate(String dt) convert date String (yyyyMMdd or yyyyMMddHHmmss) to java.sql.Date return new java.sql.Date(toUtilDate(dt).getTime()); |
java.sql.Date | toSQLDate(String sDate, String format) to SQL Date java.sql.Date sqlDate = null; Date utilDate = null; if (sDate != null) { utilDate = toUtilDate(sDate, format); sqlDate = toSQLDate(utilDate); return sqlDate; |
java.sql.Date | toSqlDateFromStrDate(String p_strDate) to Sql Date From Str Date java.sql.Date returnDate = null; java.text.DateFormat sdf = new java.text.SimpleDateFormat(); if (p_strDate != null && (!"".equals(p_strDate))) { returnDate = new java.sql.Date(sdf.parse(p_strDate).getTime()); return returnDate; |
java.sql.Date | toSqlDateJdbcEscape(final String str) to Sql Date Jdbc Escape try { return java.sql.Date.valueOf(str); } catch (final IllegalArgumentException ex) { return null; |
String | toSqlDateString(java.sql.Date d, String pattern) to Sql Date String String rs = ""; try { SimpleDateFormat formatter = new SimpleDateFormat(pattern); rs = formatter.format(d); } catch (Exception e) { e.printStackTrace(); return isFirstStartDate(rs) ? "" : rs; ... |