Date to timestamp conversion
Hello Everyone I have a DB type field
TimeStamp in oracle and
Date Type field in Java Class...
Can any one suggest me the optimal way to insert and retrive this value ..
I mean if I insert
{ts '2003-07-15 16:52:09.14'}
It should be
'2003-07-15 16:52:09.14'
in Date Type of class...
Currently what is happening is
Timestamp ts=_rs.getTimestamp(columnIndex);
if(ts==null) return null;
Date d1= new Date(ts.getTime());
Date d= new Date(ts.getTime() + (ts.getNanos()/1000000));
if(convertb) d = Util.ReferenceTZ2Local(d);
return new JDatetime(d);
}
I am doing this and it get converted to something else
2003-07-15 16:52:09.420