Solved

Capturing Date TimeStamp information

Posted on 2011-09-15
7
287 Views
Last Modified: 2012-05-12
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
Comment
Question by:abuyusuf35
  • 4
  • 2
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 36543013
How are you inserting the timestamp into the db?
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 36543025
you should be sending it as timestamp,

ps.setTimestamp( index, new Timestamp( Calendar.getInstance().getTime() ) ) ;
0
 

Author Comment

by:abuyusuf35
ID: 36543045
Sorry, forgot to mention we are using hibernate probably we are missing the Timestamp parameter ?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 36543072
Check your mapping in Hibernate
0
 

Author Comment

by:abuyusuf35
ID: 36543085
I think I know what it is - changed the Hibernate type from Date to Timestamp now I see the time in the DB
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36543146
Good - so it was your mapping, as i said
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36575322
:)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to configure empty element in XML Document parser? 15 36
Java basic valueOf question 1 29
collection output issue 9 37
subtr returning incorrect value 8 31
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question