A somewhat unrelated side issue is that
JDBC is a string-based API anyway. Any data will be sent to the database as a string, not as (e.g.) a date. So if the formatting were done in the DB, then the date would be formatted to a string by JDBC, then sent to the DB, and then be re-formatted according to your rules (and then be parsed and stored by the DB in its own format, whatever that may be). So just based on that I'd guess that doing the formatting in Java has a chance of being faster.