Since there's already a way to get a ResultSet through connection.getMetaData().getTables(), my inclination would be to just have this output to stdout. Otherwise, you'd need some other command to print out the table names.