File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storring only current time database

 
Kunal Lakhani
Ranch Hand
Posts: 622
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to store only current time (HH:mm:ss) in database. I am using hibernate and Oracle as db. What datatype should i use for time in my Bean class?
Also, what datatype should i use in oracle (for table creation)?
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oracle does not have a time only data type. As far as your object is concerned you can use a java.sql.time object or you can use a Date or Calandar object and annotate it with @Temporal(TemporalType.TIME)

For the other part of your problem have a look at this post:
http://stackoverflow.com/questions/5732111/jpa-2-0-and-oracle-with-temporaltype-time


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic