File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Regading java.sql.Date class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Regading java.sql.Date class" Watch "Regading java.sql.Date class" New topic

Regading java.sql.Date class

T sandya
Ranch Hand

Joined: Aug 03, 2006
Posts: 64
Hi freinds,
I saw in API,i am not getting what exactly it is that's why i am asking.What is the exact difference between and and why we have convert to sql date while storing date into database.if we won't convert what will happen.please clarify me.

thanks and regards,
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32811

java.sql.Date is a subclass of java.util.Date. The JDBC APIs all take a java.sql.Date so you have to convert. If you don't convert, the code won't compile.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Regading java.sql.Date class
It's not a secret anymore!