X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id B7AD711F6760 for ; Thu, 13 Apr 2006 11:51:38 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.6 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5 tests=[BAYES_00=-2.599, SPF_PASS=-0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id hfwX-vuFrfA4 for ; Thu, 13 Apr 2006 11:51:37 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.234]) by postgresql.org (Postfix) with ESMTP id 9DD6B11F6767 for ; Thu, 13 Apr 2006 11:51:33 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 67so115343wri for ; Thu, 13 Apr 2006 07:51:34 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:cc:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding:sender; b=nb/Y7je/J3e9TXO4LPzKLdyikoJKFtJJU0o2gNwpnloAE7SEpe7TgBY1xgJUxvcS4Qrik2wW38ydplhetFWyMALLX6EapF9J0PHK7j5CkUOJ21OWp9Zvg4ToAucg0fWvq3ReyjHsL9MMm8BJFNh7fBnM84AiRmeIhmn40ciCVAk= Received: by 10.65.180.16 with SMTP id h16mr378759qbp; Thu, 13 Apr 2006 07:51:33 -0700 (PDT) Received: from ?192.168.1.31? ( [82.247.148.168]) by mx.gmail.com with ESMTP id d5sm64266qbd.2006.04.13.07.51.32; Thu, 13 Apr 2006 07:51:33 -0700 (PDT) Message-ID: <443E656C.20003@free.fr> Date: Thu, 13 Apr 2006 16:51:24 +0200 From: "Xavier Poinsard" User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: fr, en MIME-Version: 1.0 To: Olav Gjerde CC: pgsql-jdbc@postgresql.org Subject: Re: Date format problem with INSERT statement. References: <20060413143814.60372.qmail@web86913.mail.ukl.yahoo.com> In-Reply-To: <20060413143814.60372.qmail@web86913.mail.ukl.yahoo.com> X-Enigmail-Version: 0.92.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200604/97 X-Sequence-Number: 15031 You should consider using the jdbc escape format for dates {d 'yyyy-mm-dd'} => INSERT INTO wdata (date) VALUES ({d '2006-04-13'); see http://jdbc.postgresql.org/documentation/head/escapes-datetime.html Olav Gjerde a écrit : > If I do an: > > INSERT INTO wdata (date) > VALUES ('13.04.06'); > > From the Query Tool in PGAdmin it will insert the dd.mm.yy format > correctly without problems. > > > But when I do this in Java I get this error message > > SQLException: ERROR: date/time field value out of range: "13.04.06" > SQLState: 22008 > VendorError: 0 > > This is because it reads the date format as mm.dd.yy because when I > insert with the value '12.04.06' it works perfect. I've changed the > datestyle in my Database to European but it still doesn't work. Do the > JDBC driver only insert dates in the US format? > > Olav