Over a million developers have joined DZone.

Java: Util.Date To Sql.Date

DZone's Guide to

Java: Util.Date To Sql.Date

· ·
Free Resource
/* 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());

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}