• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Wanna see my flashlight? How about this tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic