aspose file tools*
The moose likes JDBC 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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Regading java.sql.Date class" Watch "Regading java.sql.Date class" New topic
Author

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 java.util.date and java.sql.date 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,
sandya.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Sandya,
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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regading java.sql.Date class