I am trying to store the current timestamp in an oracle table field defined as TIMESTAMP(6).
I set it through a setter method that looks like:
void org.samples.Invoice.setCreated(Calendar value)
I am setting the field using Calendar.getInstance().
Invoice inv = new Invoice();
inv.setCreated(Calendar.getInstance());
I am seeing the timestamp that gets inserted has the correct date, but the time is always getting set as 00:00:00.0
Can you please tell me what am I doing wrong here?
May be some other code is calling
invoice.getCreated()and setting the time fileds to be zero. i.e. a pass-by-reference side effect