@Test public void testString() throws Exception { JdbcResultRow row = new JdbcResultRow(); row.setFieldValue("testField", "2013-08-22", Types.DATE); try { translator.translate(row, 0); fail(); } catch (Exception ex) { } try { translator.translate(row, "testField"); fail(); } catch (Exception ex) { } }
@Override public String translate(JdbcResultRow rs, int column) throws SQLException, IOException { Object fieldValue = rs.getFieldValue(column); if(fieldValue instanceof GregorianCalendar) fieldValue = ((GregorianCalendar) fieldValue).getTime(); return toString((Date) fieldValue); }
DateColumnTranslator implements ColumnTranslator { @Override public String translate(JdbcResultRow rs, int column) throws SQLException, IOException { Object fieldValue = rs.getFieldValue(column); if(fieldValue instanceof GregorianCalendar) fieldValue = ((GregorianCalendar) fieldValue).getTime(); return toString((Date) fieldValue); } }
DateColumnTranslator implements ColumnTranslator { @Override public String translate(JdbcResultRow rs, int column) throws SQLException, IOException { Object fieldValue = rs.getFieldValue(column); if(fieldValue instanceof GregorianCalendar) fieldValue = ((GregorianCalendar) fieldValue).getTime(); return toString((Date) fieldValue); } DateColumnTranslator(); }
DateColumnTranslator implements ColumnTranslator { @Override public String translate(JdbcResultRow rs, int column) throws SQLException, IOException { Object fieldValue = rs.getFieldValue(column); if(fieldValue instanceof GregorianCalendar) fieldValue = ((GregorianCalendar) fieldValue).getTime(); return toString((Date) fieldValue); } DateColumnTranslator(); @Override String translate(JdbcResultRow rs, int column); @Override String translate(JdbcResultRow rs, String columnName); String getDateFormat(); void setDateFormat(String format); }
DateColumnTranslator implements ColumnTranslator { @Override public String translate(JdbcResultRow rs, int column) throws SQLException, IOException { Object fieldValue = rs.getFieldValue(column); if(fieldValue instanceof GregorianCalendar) fieldValue = ((GregorianCalendar) fieldValue).getTime(); return toString((Date) fieldValue); } DateColumnTranslator(); @Override String translate(JdbcResultRow rs, int column); @Override String translate(JdbcResultRow rs, String columnName); String getDateFormat(); void setDateFormat(String format);  }