File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet getDate conversion to Util Date?

 
Peter White
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it a general practice to do something like the following:

java.util.Date myDate = new java.util.Date(rs.getDate(col).getTime());

Or is there a better technique? I read somewhere that doing the above might change the date because of a nanosecond bug in Java?

Thanks

Peter
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33699
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,
That's what I've always used. I haven't had any conversion problems, but that doesn't mean there isn't a problem.
 
Peter White
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the issue I saw was maybe more to do with sybase only storing fractions of seconds. Basically I was getting a slightly different date back from what I was storing.

Thanks

Peter
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic