Announcement Announcement Module
No announcement yet.
How to set the connection time zone (Oracle, JdbcTemplate, Session Time Zone not set) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to set the connection time zone (Oracle, JdbcTemplate, Session Time Zone not set)

    I'm doing backend stuff, no UI/MVC framework.

    My Datasource is configured using dbcp over Oracle.

    I'm getting errors (Session Time Zone not set!) when accessing tables with TIMESTAMP WITH LOCAL TIME ZONE types.

    My JVM time zone is properly set. I've checked with TimeZone.getDefault().


    1) How do I properly configure the Oracle jdbc driver with a default timezone, preferably the jvm default one, in a Spring environment?

    2) How do I dynamically set the connection time zone for the current thread/http request when I get this information from the user profile or the http request itself?

    Thank you very much!


  • #2
    in my app also same problem please any replies


    • #3
      How are you accessing the database? If you are using JDBC then the easiest solution would be to use the getTimestamp method where you pass in a Calendar instance.


      • #4
        I'm experiencing another problem which needs the same setting.

        On my Oracle Database I have a trigger which updates a field 'updated_date' this trigger uses oracle's 'localtimestamp'.
        But this depends on the connection settings of the jdbc. Obviously the problem is that this is wrong and localtimestamp is 2hrs off.
        I've been googling for a solution. But I can't find anything where i can setup the timezone. The timezone of my tomcat catalina webserver is the correct timezone. And so is the timezone on the oracle machine.
        Last edited by jeda; Jun 4th, 2008, 01:22 AM.


        • #5
          And thennn???


          Any update on this???

          I so lovely when you are searching for something and you find a post with exactly the same issue that you are looking for and the post owner did NOT update with the solution!!!


          • #6
            Concerning my problem posted in 2008, We've updated the oracle jdbc driver and that solved the problem.
            Currently we have oracle ojdbc14- in production without any problems of the timezone. (it was also in the changelog of that version if I remember correctly).
            Now if you are already on or .5 then i would not know how to solve it :s sorry.


            • #7
              Hi there.... thanks for the answer!

              I'm putting together my finds and thoughts regarding this issue using other site , please check THIS LINK