File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with data field from db

 
Rafael Fagundes
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I�m developping an application with MySQL db. When I try to get a data field with resultset.getDate("field"), the date it�s null (when it shouldn�t be). If i use resultset.getString("field"), the date it�s 0000-00-00. What�s thr problem? What should i do?
Thank�s for your attention.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would you like to do?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the JDBC forum...
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the type of your "field". if it is Date then you should do like,

resultSet.getDate("field");

if it is String then you should do like,

resultSet.getString("field");

but it should be Date. and are you sure you have some values in your Date field?? try to get the record using some Database client tool.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic