@Test public void rdbmsTimeStampTest() { final Timestamp timestamp = new Timestamp(1446040543364L); final DataRdbms data = instance.getData(timestamp); Assert.assertEquals(data.getValue(), "2015-10-28 13:55:43.364000000"); Assert.assertEquals(data.getParameter(), "'2015-10-28 13:55:43.364000000'"); }
public DataRdbms getData(final Object object) { if (object instanceof Timestamp) { final Timestamp timestamp = (Timestamp) object; final DateFormat df = new SimpleDateFormat(DATE_PATTERN); final NumberFormat nf = new DecimalFormat("000000000"); final String dateString = df.format(timestamp) + nf.format(timestamp.getNanos()); return new GenericDataRdbms(dateString, "'"); } else if (object instanceof Date) { final DateFormat df = new SimpleDateFormat(DATE_PATTERN_MILLISECONDS); final String dateString = df.format(object); return new GenericDataRdbms(dateString, "'"); } return genericRdbms.getData(object); }
Db2RdbmsSpecifics implements RdbmsSpecifics { public DataRdbms getData(final Object object) { if (object instanceof Timestamp) { final Timestamp timestamp = (Timestamp) object; final DateFormat df = new SimpleDateFormat(DATE_PATTERN); final NumberFormat nf = new DecimalFormat("000000000"); final String dateString = df.format(timestamp) + nf.format(timestamp.getNanos()); return new GenericDataRdbms(dateString, "'"); } else if (object instanceof Date) { final DateFormat df = new SimpleDateFormat(DATE_PATTERN_MILLISECONDS); final String dateString = df.format(object); return new GenericDataRdbms(dateString, "'"); } return genericRdbms.getData(object); } }
Db2RdbmsSpecifics implements RdbmsSpecifics { public DataRdbms getData(final Object object) { if (object instanceof Timestamp) { final Timestamp timestamp = (Timestamp) object; final DateFormat df = new SimpleDateFormat(DATE_PATTERN); final NumberFormat nf = new DecimalFormat("000000000"); final String dateString = df.format(timestamp) + nf.format(timestamp.getNanos()); return new GenericDataRdbms(dateString, "'"); } else if (object instanceof Date) { final DateFormat df = new SimpleDateFormat(DATE_PATTERN_MILLISECONDS); final String dateString = df.format(object); return new GenericDataRdbms(dateString, "'"); } return genericRdbms.getData(object); }  }
Db2RdbmsSpecifics implements RdbmsSpecifics { public DataRdbms getData(final Object object) { if (object instanceof Timestamp) { final Timestamp timestamp = (Timestamp) object; final DateFormat df = new SimpleDateFormat(DATE_PATTERN); final NumberFormat nf = new DecimalFormat("000000000"); final String dateString = df.format(timestamp) + nf.format(timestamp.getNanos()); return new GenericDataRdbms(dateString, "'"); } else if (object instanceof Date) { final DateFormat df = new SimpleDateFormat(DATE_PATTERN_MILLISECONDS); final String dateString = df.format(object); return new GenericDataRdbms(dateString, "'"); } return genericRdbms.getData(object); }  boolean isRdbms(final String classType); DataRdbms getData(final Object object); String getTypeQuery(final String sql); int beginQuery(String sql, int index); String removeComment(final String sql); boolean isCaseSensitive(); }
Db2RdbmsSpecifics implements RdbmsSpecifics { public DataRdbms getData(final Object object) { if (object instanceof Timestamp) { final Timestamp timestamp = (Timestamp) object; final DateFormat df = new SimpleDateFormat(DATE_PATTERN); final NumberFormat nf = new DecimalFormat("000000000"); final String dateString = df.format(timestamp) + nf.format(timestamp.getNanos()); return new GenericDataRdbms(dateString, "'"); } else if (object instanceof Date) { final DateFormat df = new SimpleDateFormat(DATE_PATTERN_MILLISECONDS); final String dateString = df.format(object); return new GenericDataRdbms(dateString, "'"); } return genericRdbms.getData(object); }  boolean isRdbms(final String classType); DataRdbms getData(final Object object); String getTypeQuery(final String sql); int beginQuery(String sql, int index); String removeComment(final String sql); boolean isCaseSensitive();  }