Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

difference between java.sql.time and java.sql.timestamp in java  RSS feed

 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a DB table, with a column of type Time.
I'm wondering in the JDBC, should I use java.sql.Time or java.sql.Timestamp to save this column value?

Which one is better? Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36875
481
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what you want to save. If just time, java.sql.Time. If date and time, TimeStamp.

The database time type implies just time, but the exact meaning could vary based on the database.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!