This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Why this OverFlow error during updating? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Why this OverFlow error during updating?" Watch "Why this OverFlow error during updating?" New topic
Author

Why this OverFlow error during updating?

arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 305
Hello,
I am just trying to update a record in my table. I am using the following:-
1.Windows 2000
2. Microsoft SQL 7.0
3. Java 1.3
4. "cd" field is of datetime data type
The following program gives me error:

D:\>java SetAppDate
Error in SetAppDate: java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]D
atetime field overflow

Could u please help me to sort this issue?
regards,
Arun
Paulo Salgado
Ranch Hand

Joined: Jan 18, 2002
Posts: 98
Arun,
I've done that successfully using DB2. The driver converted the java.sql.Timestamp into the TIMESTAMP column as expected. You may want to print the stack trace to make sure the source of the error is the driver and if that's the case, look for bug/limitations info and/or try another (if any) driver available for SQLServer.
Good luck.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Timestamp sdt = new Timestamp(1980,1,1,0,0,0,0) --> This is a deprecated constructor. Try using the 'public Timestamp(long time)' constructor instead. It may or may not have contributed to your problem.
Jamie
arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 305
Thanks for your reply.
1. I don't think there is any driver limitation as I could easily use this for my other query. SO driver limitation for Timestamp is out of question.
2. As far as the Deprecated method is concern I again don't see any reason with it. My objective here was to put a date explicitly here so thought of this method.
Ok but will try your suggestions or perhaps looks for the other methods which are not deprecated and update you.
Anyway thanks a lot for the support.
regards,
arun
arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 305
Yes I got it corrected. It was a deprecated method which was giving trouble. I was wrong. Thanks for the support. Posting the code if someone is inerested.
regards,
arun
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Why this OverFlow error during updating?
 
Similar Threads
Problem of using setCharacterStream method to insert varchar2 data in ORACLE816
Basic Questions...Please help
Why this error StreamCorruptedException
program to make start-connect by (oracle )
Why it fails to update record