Here you can find the source of getSQLDateFromStr(String s)
public static java.sql.Date getSQLDateFromStr(String s)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { /**/*w ww.j av a 2 s.co m*/ * Convert Date String into sql Date */ public static java.sql.Date getSQLDateFromStr(String s) { java.sql.Date dte = null; try { String str = s; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); java.util.Date dt = formatter.parse(str); dte = new java.sql.Date(dt.getTime()); } catch (Exception e) { e.printStackTrace(); } return dte; } }