java util Date into a sql Date

/* This snippet shows how to convert a java util Date into a sql Date for use in databases */

java.util.Date utilDate = new java.util.Date();
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());

你可能感兴趣的:(java)