ColumnHelper { public static String toString(JdbcResultRow rs, int column) throws Exception { String value = null; Object o = rs.getFieldValue(column); if (o instanceof byte[]) { value = new String((byte[]) o); } else { value = o.toString(); } return value; }  static String translate(JdbcResultRow rs, int column); static String toString(JdbcResultRow rs, int column);  }
@Test public void testToString() throws Exception { { JdbcResultRow row = new JdbcResultRow(); row.setFieldValue("testField", "1", Types.VARCHAR); String translated = toString(row, 0); assertEquals("1", translated); } { JdbcResultRow row = new JdbcResultRow(); row.setFieldValue("testField", "1".getBytes(), Types.BINARY); String translated = toString(row, 0); assertEquals("1", translated); } }