This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes ORA-01874: time zone hour must be between -12 and 14 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ORA-01874: time zone hour must be between -12 and 14" Watch "ORA-01874: time zone hour must be between -12 and 14" New topic

ORA-01874: time zone hour must be between -12 and 14

Deb Sadhukhan
Ranch Hand

Joined: Nov 05, 2003
Posts: 67
I have an application which retrieves current time from the system (JVM) and accordingly does some oracle database updates. For testing purpose, I'm using following code to set JVM clock to past date, so that I can test the application without spending much time for setting up the test data every day. But I get the following error when when I try to connect to oracle. Any idea what's going on?

Code for setting JVM time

Error I get when I try to connect to oracle after setting the time.


_ __ _ __ _ __ _<br />SCJP 1.4 (95%) | SCWCD 1.4 (79%)<br />Artificial intelligence is no match for natural stupidity.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32319

Can you post the actual JDBC code and query that throws that error?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265


Here's a couple links from the Oracle forums that might help:

I included the second because someone in the first thread said that solved the issue, even though it was a different ORA message number.

There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
I agree. Here's the link:
subject: ORA-01874: time zone hour must be between -12 and 14
It's not a secret anymore!