[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Capturing Date TimeStamp information

Posted on 2011-09-15
7
Medium Priority
?
294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video teaches viewers about errors in exception handling.
Suggested Courses

650 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