List of utility methods to do SQL Date Get
Date | getDate(ResultSet rs, int columnIndex) get Date Timestamp t = rs.getTimestamp(columnIndex); return rs.wasNull() ? null : new Date(t.getTime()); |
Date | getDate(ResultSet rs, int index) get Date if (rs.getTimestamp(index) != null) { return new Date(rs.getTimestamp(index).getTime()); return null; |
Date | getDate(ResultSet rs, String colName) Returns a date value from a JDBC result set containing only the day part. if (colName == null || colName.length() == 0 || rs == null) { throw new IllegalArgumentException("getDate: one or more parameters are null"); Date res = convertSQLDate2Date(rs.getDate(colName)); if (rs.wasNull()) { return null; return res; ... |
java.sql.Date | getDate(ResultSet rs, String column) get a date from ResultSet rs with name 'column' java.sql.Date i = rs.getDate(column); if (rs.wasNull()) i = new java.sql.Date((long) 0); return i; |
Date | getDate(ResultSet rs, String columnLabel) get Date return rs.getDate(columnLabel);
|
Date | getDate(ResultSet rs, String columnName) get a java.util.Date object from a result set column with sql type TIMESTAMP and given name Timestamp ts = rs.getTimestamp(columnName); if (ts == null) { return null; return new Date(ts.getTime()); |
String | getDate(String aDate, int dif) get Date java.sql.Date date = null; try { date = java.sql.Date.valueOf(aDate); } catch (Exception e) { System.err.println("Application log:Catch Exception in getDate()"); System.err.println("aDate:" + aDate); System.err.println(e.getMessage()); e.printStackTrace(); ... |
Date | getDate(String date) Converts a string to date. return date != null ? java.sql.Date.valueOf(date) : null;
|
java.sql.Date | getDate(String date) This method converts date provided as a String into JDBC format. try { if ((date == null) || (date.trim().length() == 0)) return null; return new java.sql.Date(userDateFmt.parse(date).getTime()); } catch (ParseException e) { try { if ((date == null) || (date.trim().length() == 0)) return null; ... |
String | getDate(String format) get Date String d = new SimpleDateFormat(format).format(Calendar.getInstance().getTime()); return d; |