Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

luke lukes
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)?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!