We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

getting date and time from Oracle

peterwnorman
peterwnorman asked
on
Medium Priority
397 Views
Last Modified: 2010-03-31
Hey,

I'm running a query that returns a date column from an oracle db but the time part of it gets truncated when i use:

resultset.getDate("date_column")

anyone know the best way of retaining the time portion of the date?
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Top Expert 2016

Commented:
(where 'rs' is your ResultSet)
CERTIFIED EXPERT
Top Expert 2016

Commented:
>>java.util.Date date = new Date(t.getTime());

should of course be

java.util.Date date = new java.util.Date(t.getTime());
CERTIFIED EXPERT
Top Expert 2016

Commented:
8-)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.