Here is one way to format a date returned from sql queries:
// execute sql statement
ResultSet rs = stmt.executeQuery(queryString);
String[] hist = null;
int idx = 1;
hist[0] = "Date\Type";
// get resultset
while (rs.next()) {
Date tdate = rs.getDate("tdate");
String typetransaction = rs.getString("typetransaction");
hist[idx] = tdate + typetransaction;
idx++;
}
You can then display the hist array into a component, perhaps a JList or JTextArea.