/** * Print the Calendar. */ public static String printCalendar(Calendar calendar) { return printCalendar(calendar, true); }
/** * Print the Calendar. */ public static String printCalendar(Calendar calendar) { return printCalendar(calendar, true); }
/** * Print the Calendar. */ public static String printCalendar(Calendar calendar) { return printCalendar(calendar, true); }
/** * Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff) */ protected void appendSybaseCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("'"); writer.write(Helper.printCalendar(calendar)); writer.write("'"); }
/** * Write a timestamp in Informix specific format ( yyyy-mm-dd hh:mm:ss.fff) */ protected void appendInformixCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("'"); writer.write(Helper.printCalendar(calendar)); writer.write("'"); }
@Override protected void appendCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("TO_TIMESTAMP('"); writer.write(Helper.printCalendar(calendar)); writer.write("')"); }
/** * Write a timestamp in Informix specific format ( yyyy-mm-dd hh:mm:ss.fff) */ protected void appendInformixCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("'"); writer.write(Helper.printCalendar(calendar)); writer.write("'"); }
/** * Answer a platform correct string representation of a Calendar as a Timestamp, suitable for SQL generation. * The calendar is printed in the ODBC platform independent timestamp format {ts'YYYY-MM-DD HH:MM:SS.NNNNNNNNN'}. */ protected void appendCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("{ts '"); writer.write(Helper.printCalendar(calendar)); writer.write("'}"); }
/** * Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff) */ protected void appendSybaseCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("'"); writer.write(Helper.printCalendar(calendar)); writer.write("'"); }
/** * Answer a platform correct string representation of a Calendar as a Timestamp, suitable for SQL generation. * The calendar is printed in the ODBC platform independent timestamp format {ts'YYYY-MM-DD HH:MM:SS.NNNNNNNNN'}. */ protected void appendCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("{ts '"); writer.write(Helper.printCalendar(calendar)); writer.write("'}"); }
@Override protected void appendCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("TO_TIMESTAMP('"); writer.write(Helper.printCalendar(calendar)); writer.write("')"); }
/** * Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff) */ protected void appendSybaseCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("'"); writer.write(Helper.printCalendar(calendar)); writer.write("'"); }
/** * Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff) */ protected void appendSybaseCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("'"); writer.write(Helper.printCalendar(calendar)); writer.write("'"); }
/** * Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff) */ protected void appendSybaseCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("'"); writer.write(Helper.printCalendar(calendar)); writer.write("'"); }
/** * Write a timestamp in Informix specific format ( yyyy-mm-dd hh:mm:ss.fff) */ protected void appendInformixCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("'"); writer.write(Helper.printCalendar(calendar)); writer.write("'"); }
/** * Answer a platform correct string representation of a Calendar as a Timestamp, suitable for SQL generation. * The calendar is printed in the ODBC platform independent timestamp format {ts'YYYY-MM-DD HH:MM:SS.NNNNNNNNN'}. */ protected void appendCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("{ts '"); writer.write(Helper.printCalendar(calendar)); writer.write("'}"); }
/** * Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff) */ protected void appendSybaseCalendar(Calendar calendar, Writer writer) throws IOException { writer.write("'"); writer.write(Helper.printCalendar(calendar)); writer.write("'"); }
/** * This conversion required the use of the literal string to get the same * functionality as the native SQL to_timestamp() approach. */ public static TIMESTAMPTZ buildTIMESTAMPTZ(Calendar cal, Connection con, boolean shouldPrintCalendar) throws SQLException { //Bug5614674. It used to be a driver bug and Helper.printCalendar(cal, false) was used to make it work. It has been fixed in 11. Separate the newer version from the old ones. if (shouldPrintCalendar) { return new TIMESTAMPTZ(con, Helper.printCalendar(cal, false), cal); } else { return new TIMESTAMPTZ(con, new Timestamp(cal.getTimeInMillis()), cal); } }
/** * This conversion required the use of the literal string to get the same * functionality as the native SQL to_timestamp() approach. */ public static TIMESTAMPTZ buildTIMESTAMPTZ(Calendar cal, Connection con, boolean shouldPrintCalendar) throws SQLException { //Bug5614674. It used to be a driver bug and Helper.printCalendar(cal, false) was used to make it work. It has been fixed in 11. Separate the newer version from the old ones. if (shouldPrintCalendar) { return new TIMESTAMPTZ(con, Helper.printCalendar(cal, false), cal); } else { return new TIMESTAMPTZ(con, new Timestamp(cal.getTimeInMillis()), cal); } }
/** * Build a calendar string based on the calendar fields. * If the daylight savings time should be printed and the zone is in daylight savings time, * print the short representation of daylight savings from the calendar's timezone data. */ public static String printCalendar(Calendar calendar) { if (calendar == null) { return "null"; } StringWriter writer = new StringWriter(); writer.write(Helper.printCalendar(calendar, false)); writer.write(" "); writer.write(calendar.getTimeZone().getID()); // If we should print daylight savings and the zone is reported to be using daylight time, // write the short representation of the daylight time in the writer. if (shouldAppendDaylightTime(calendar)) { writer.write(" "); writer.write(calendar.getTimeZone().getDisplayName(true, TimeZone.SHORT)); } return writer.toString(); }