Here you can find the source of getDate(String year, String month, String day)
public static java.sql.Date getDate(String year, String month, String day)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; public class Main { public static java.sql.Date getDate(String year, String month, String day) { java.sql.Date result = null; try {/* w w w.j a v a 2 s . c om*/ String str = year + "-" + month + "-" + day; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); java.util.Date date1 = dateFormat.parse(str); result = new java.sql.Date(date1.getTime()); } catch (Exception e) { System.out.println("Exception " + e); } return result; } }