Here you can find the source of getDateTime(ResultSet rs, String field, Calendar cal)
@SuppressWarnings("deprecation") public static Date getDateTime(ResultSet rs, String field, Calendar cal) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.ResultSet; import java.sql.SQLException; import java.util.Calendar; import java.util.Date; public class Main { @SuppressWarnings("deprecation") public static Date getDateTime(ResultSet rs, String field, Calendar cal) throws SQLException { Date date = rs.getDate(field, cal); Date time = rs.getTime(field, cal); if (date == null || time == null) { return null; } else {/*w ww .j ava 2s .c om*/ cal.clear(); cal.set(1900 + date.getYear(), date.getMonth(), date.getDate(), time.getHours(), time.getMinutes(), time.getSeconds()); return cal.getTime(); } } }