MySQL - getDate() - no time !

Hi

I have a DATETIME column in my database, i have checked using mysql and its is storing the data and time portion.. i am using RecordSet.getDate but only getting back the date portion. how do i get the date and time

-P
LVL 10
makerpAsked:
Who is Participating?
 
aozarovCommented:
>> new java.util.Date( yourRecordSet.getDate( column ).getTime() );
That will not work. java.sql.Date holds only the date part. you should call getTimestamp instead.
0
 
RomanRegaCommented:
Can't you call getTime() ??
0
 
RomanRegaCommented:
Or try something like this:

new java.util.Date( yourRecordSet.getDate( column ).getTime() );
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
aozarovCommented:
>> getDate( column ).getTime() ...
That is a bad example from the JDK where they should not have extend java.util.Date (getTime comes from there but is meaningless), but rather use Containment...
0
 
makerpAuthor Commented:
cheers :)
0
 
aozarovCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.