• Post Reply Bookmark Topic Watch Topic
  • New Topic

SQLite JDBC - ResultSet rs.getDate doesn't work correctly

 
luke lukes
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone. i'm trying to retrieve data from SQLite JDBC for a little desktop application. I have a table LETTURE created with:

now, while the insertion is quite a flawless process with (example):


retrieve data via JDBC, so through a ResultSet, it's quite problematic:

what i find on rs.getDate("data") is always 01/01/1970. Note that the date is correctly inserted on db, in fact i can retrieve it correctly using shell:


i've tried also to create the table using TIME instead of DATE as datatype for 'data' column, and retrieving data with both rs.getData("data") and rs.getTime("data"), but the result is always the same: 01/01/1970. do you know if maybe i use the wrong type in java (Date instead of something else)?

thanks
LuKe
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!