pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schaber <schabi@logix-tt.com>
To: George Woodring <george.woodring@iglass.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Automated setting of timezone with connection pooling
Date: Wed, 26 Apr 2006 10:30:51 +0200
Message-ID: <444F2FBB.1060101@logix-tt.com> (raw)
In-Reply-To: <1B1B254441DB31448BD34C5BD73B0B8B2904B1@PHOENIX.istructure.com>
References: <1B1B254441DB31448BD34C5BD73B0B8B2904B1@PHOENIX.istructure.com>

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



view thread (3+ messages)

Message-ID: <444F2FBB.1060101@logix-tt.com>
Permalink:  ../444F2FBB.1060101@logix-tt.com/
Also on:    postgresql.org/message-id/444F2FBB.1060101@logix-tt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: schabi@logix-tt.com, george.woodring@iglass.net
  Subject: Re: Automated setting of timezone with connection pooling
  In-Reply-To: <444F2FBB.1060101@logix-tt.com>
  References: <1B1B254441DB31448BD34C5BD73B0B8B2904B1@PHOENIX.istructure.com> <444F2FBB.1060101@logix-tt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox