[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Capturing Date TimeStamp information

Hi - We are trying to capture data time stamp information for auditing purposes - our code passes the date as Calendar.getInstance().getTime() which has this information but it always turns up as 12.00.00.000000000 AM in the DB - the data type we are using is TIMESTAMP(6) and the DB is Oracle - should we be using a different data type ? Thanks
0
abuyusuf35
Asked:
abuyusuf35
  • 4
  • 2
1 Solution
 
CEHJCommented:
How are you inserting the timestamp into the db?
0
 
ksivananthCommented:
you should be sending it as timestamp,

ps.setTimestamp( index, new Timestamp( Calendar.getInstance().getTime() ) ) ;
0
 
abuyusuf35Author Commented:
Sorry, forgot to mention we are using hibernate probably we are missing the Timestamp parameter ?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
CEHJCommented:
Check your mapping in Hibernate
0
 
abuyusuf35Author Commented:
I think I know what it is - changed the Hibernate type from Date to Timestamp now I see the time in the DB
0
 
CEHJCommented:
Good - so it was your mapping, as i said
0
 
CEHJCommented:
:)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now