wood burning stoves 2.0*
The moose likes JDBC and the fly likes java Date  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java Date  " Watch "java Date  " New topic
Author

java Date

Satyam Jaiswal
Greenhorn

Joined: Jan 17, 2007
Posts: 1
I have a java standalone application, It uses Date dt = new Date(); for getting current date and store it in datebase. But sometimes it stores Date like 2021-08-27 17:53:28, 2012-05-28 21:00:17, 3300-12-15 15:25:46, 3006-12-02 05:45:55 or sometimes fails to store in database while trying to save 30062007-12-02 05:45:55.
It happens very rarely, so fail to distinguish the problem.
Please help me out if anybody had this problem or have something on the mind.

Thanks
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"Satyam ecstasy",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning

thanks,
Dave
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

It sounds like you have a bug somewhere in your code that stores or retrieves the date in the database.

Without more details (and perhaps a code listing of your code), it is very hard to give you any useful answer.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
jQuery in Action, 2nd edition
 
subject: java Date
 
Similar Threads
an interesting arithmetic, need help.
Project Euler problems with Scala
OC4J 10g StandAlone using HTTPS Tunneling Problem
getting the time in milliseconds
Problem moving columns and rows in 2D array.