Difference between java.util.Date and java.sql.Date in Java or why does Java has java.sql.Date if there is already a Date class in java util package is a common java interview question. There is always confusion among many Java developer familiar with both java.util.Date and java.sql.Date. Though many of them already using java.sql.Date to interface with DATE type of any relational database like mysql, oracle or any other database. In this Java tutorial we will see some differences between java.sql.Date and java.util.Date which will help to understand both of them better.
This Java tutorial is in continuation of our earlier post on java.util.Date like How to convert String to Date in Java and how to get current Date and Time value in GMT timezone. if you haven't read them already you may find them interesting and useful. If you like JDBC articles then checkout some JDBC Performance tips and Benefits of PreparedStatement in Java.