Win a copy of Functional Reactive Programming this week in the Other Languages 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: 34973
379
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