Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

getting date and time from Oracle

Posted on 2004-04-01
4
Medium Priority
?
380 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?
0
Comment
Question by:peterwnorman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 10733821
Use

Timestamp t = rs.getTimestamp(1);
java.util.Date date = new Date(t.getTime());
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10733827
(where 'rs' is your ResultSet)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10733838
>>java.util.Date date = new Date(t.getTime());

should of course be

java.util.Date date = new java.util.Date(t.getTime());
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10734586
8-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question