convert java date to sql date

Solutions on MaxInterview for convert java date to sql date by the best coders in the world

showing results for - "convert java date to sql date"
Violeta
21 Apr 2016
1public class MainClass {
2
3  public static void main(String[] args) {
4    java.util.Date utilDate = new java.util.Date();
5    java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
6    System.out.println("utilDate:" + utilDate);
7    System.out.println("sqlDate:" + sqlDate);
8
9  }
10
11}
12