Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with data field from db  RSS feed

 
Rafael Fagundes
Ranch Hand
Posts: 52
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would you like to do?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the JDBC forum...
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!