This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regading java.sql.Date class

 
T sandya
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic