Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getDate() , getTime()

843854Oct 26 2001 — edited Oct 29 2001
Hi,
I have the following problem
1) reading a datetime - value out of a result set:
scol is the name of the column
sval=rsActualRow.getString(scol)
result: 2001-09-27 15:07:41.000

2)then I do this:
Date dTempDat=rsActualRow.getDate(scol);
and the result, only the date-part 2001-09-27

but what I need is a variable of type date containing the full date + time information (2001-09-27 15:07:41.000)

I tried this:
long milliseconds1=rsActualRow.getDate(scol).getTime();
long milliseconds2=rsActualRow.getTime(scol).getTime();
Date dTempDat = new java.sql.Date(milliseconds1 + milliseconds2);

BUT THIS ALSO DOESNT WORK ....


some suggestions would be helpful
Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2001
Added on Oct 26 2001
3 comments
120 views