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
JavaRanch » Java Forums » Databases » JDBC
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 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,
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30123

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
Similar Threads
how to generate sql date
util.Date to sql.Date
HELP - java.sql.Date
JDBC Problem with Date insertion
Save date to the database