Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert java.util.Date to java.sql.Date

 
Kop Ite
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi
I am trying to convert a java.util.Date into java.sql.Date as below:
java.util.Date aDate
(java.sql.Date) aDate
< where aDate = Mon Nov 11 00:00:00 GMT 2002 >
I am getting exception:
java.lang.ClassCastException: java.util.Date
How do I sort this out so it will work remembering that aDate value is set in stone, so nothing can be done with that, must be converted into java.sql.Date.
Help !!
thanks
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Kop Ite
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks works a treat
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic