Here you can find the source of date2String(java.sql.Date date)
@SuppressWarnings("deprecation") public static String date2String(java.sql.Date date)
//package com.java2s; public class Main { @SuppressWarnings("deprecation") public static String date2String(java.sql.Date date) { if (date == null) return ""; return (date.getYear() + 1900) + "-" + (date.getMonth() + 1) + "-" + date.getDate();/*from ww w . j a va 2 s. c o m*/ } }