Announcement Announcement Module
Collapse
No announcement yet.
How to set the connection time zone (Oracle, JdbcTemplate, Session Time Zone not set) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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().

    Questions:

    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!

    Remy

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

    Comment


    • #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.

      Comment


      • #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, 02:22 AM.

        Comment


        • #5
          And thennn???

          Friends,

          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!!!

          Comment


          • #6
            Concerning my problem posted in 2008, We've updated the oracle jdbc driver and that solved the problem.
            Currently we have oracle ojdbc14-10.2.0.4.jar 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 10.2.0.4 or .5 then i would not know how to solve it :s sorry.

            Comment


            • #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

              Comment

              Working...
              X