Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 1CA7D9FB4D0 for ; Fri, 7 Sep 2007 09:30:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 60556-02-6 for ; Fri, 7 Sep 2007 09:30:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 441189FB5E0 for ; Fri, 7 Sep 2007 09:28:58 -0300 (ADT) Received: from 222-154-136-236.jetstream.xtra.co.nz ([222.154.136.236] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1ITcxB-0006Sf-82; Sat, 08 Sep 2007 00:28:53 +1200 Message-ID: <46E143FE.2070407@opencloud.com> Date: Sat, 08 Sep 2007 00:28:46 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: "Laurent LS. Savary" CC: pgsql-jdbc@postgresql.org Subject: Re: Jdbc : DateStyle problem References: <479CB622341AE44B81A6577D934714EE058F62@CETAUTOMATIX.medial.fr> In-Reply-To: <479CB622341AE44B81A6577D934714EE058F62@CETAUTOMATIX.medial.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/64 X-Sequence-Number: 17486 Laurent LS. Savary wrote: > But,why the modification of the datestyle, set by psql (alter > database....), on my database is not effective on a jdbc session? The JDBC driver resets DateStyle to a known value on each connection so that it knows how to correctly format date values sent to the backend, and correctly parse date values returned by the backend. Really you should be using the JDBC methods that deal in terms of java.sql.Date if you are manipulating dates (i.e. PreparedStatement.setDate(), ResultSet.getDate() and so on). The driver will then correctly handle the date value interpretation for you. -O