Te code snippet below shows how to use java.sql.Date.It gives date in SQL format.

Java Code:
java.util.Date today = new java.util.Date();
java.sql.Date sqlToday = new java.sql.Date(today.getTime());
		
System.out.println("Date: " + today );
System.out.println("SQLDate: " + sqlToday);
Output:

Java Code:
Date: Sun Feb 10 11:30:58 CET 2008
SQLDate: 2008-02-10