Here you can find the source of toSqlDate(int year, int month, int day)
public static java.sql.Date toSqlDate(int year, int month, int day)
//package com.java2s; //License from project: Open Source License public class Main { public static java.sql.Date toSqlDate(int year, int month, int day) { //SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); String s = "" + year + "-" + two(month) + "-" + two(day); return java.sql.Date.valueOf(s); }//from w ww . j av a2 s .c o m public static String two(int tt) { String ss = ""; return (tt + "").length() > 1 ? (tt + "") : "0" + tt; } }