I don't see any code that retrieves dates from a DB, but the ResultSet.getDate method returns a Date object that can be formatted any way you want.
Then when you extract the date from the database, use a SimpleDateFormat object to convert it to a string in that format. That part of the question has nothing to do with the database at all.
Originally posted by Rajkumar balakrishnan:
I want the date to be displayed as in dd-MM-yyyy format...
the da is the SQLDATE format
SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM/yyyy");
d = DATE_FORMAT.parse(date);
date = DATE_FORMAT.format(d);
java.sql.Date da = java.sql.Date.valueOf(date);
Are you clear!!!
Is that meant to encourage me to help you? It achieves rather the opposite.