Re: Automated setting of timezone with connection pooling

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: George Woodring <george(dot)woodring(at)iglass(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Automated setting of timezone with connection pooling
Date: 2006-04-26 08:30:51
Message-ID: 444F2FBB.1060101@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi, Woody,

George Woodring wrote:
> We have multiple databases in a cluster ( one for each of our customers
> ) which the default time zone needs to be different. We are currently
> using dbcp to do our connection pooling. Can anyone recommend a good
> way of automatically setting the timezone when the connection is made?

Chris already pointed out how to set the time zones per database and per
user.

Some connection poolings also include the possibility to specify
commands which are executed after connecting and before reusing a
connection. For JBoss foo-ds.xml, the syntax would be like:

<datasources>
<no-tx-datasource>
<jndi-name>...</jndi-name>
<connection-url>...</connection-url>
<!-- other settings ... -->
<new-connection-sql>SET timezone TO 5</new-connection-sql>
<check-valid-connection-sql>SET timezone TO
5</check-valid-connection-sql>
</no-tx-datasource>
</datasources>

HTH,
Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2006-04-26 20:25:09 Re: Prepared statement leak
Previous Message Kris Jurka 2006-04-26 00:12:25 Re: Money deprecation and cast problem