Create java.sql.Date Using java.util.Date in Java
Description
The following code shows how to create java.sql.Date Using java.util.Date.
Example
// w w w. ja va2 s .c o m
public class Main {
public static void main(String[] args) {
java.util.Date today = new java.util.Date();
System.out.println(new java.sql.Date(today.getTime()));
}
}
The code above generates the following result.