aspose file tools
The moose likes JDBC and the fly likes problem with java.sql.date Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "problem with java.sql.date" Watch "problem with java.sql.date" New topic
Author

problem with java.sql.date

HimaBindu Gudey
Greenhorn

Joined: Oct 01, 2005
Posts: 1
Hi All,

I have a problem with java.sql.Date.I want to store date and time in database where the field type is Date. From java I want to insert date and time .The method takes java.sql.Date.If I am using like this
row.setAdtDttm(new Date(System.currentTimeMillis())) ,only the date is getting stored.And time is stored as 00:00:00.
Can anyboby has any clue how to resolve this.
Annie Smith
Ranch Hand

Joined: Mar 05, 2005
Posts: 172
Use java.sql.Timestamp instead.


Cheers!<br /><b>Annie</b>
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: problem with java.sql.date
 
Similar Threads
Validate date and time in locat time.
how to get the response time
SimpleDateFormatter shows wrong hour?
Trying to see if incoming date parameter has a time attached or not (wwithout using midnight)
roll doesn't work properly