X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9ED7C32A081 for ; Thu, 30 Sep 2004 11:14:30 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 21388-08 for ; Thu, 30 Sep 2004 10:14:19 +0000 (GMT) Received: from mosaic02.mosaic.de (mosaic02.mosaic.de [195.247.16.18]) by svr1.postgresql.org (Postfix) with ESMTP id B1EF432A09B for ; Thu, 30 Sep 2004 11:14:20 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by mosaic02.mosaic.de (Postfix) with ESMTP id 9E52E91FDD; Thu, 30 Sep 2004 12:14:18 +0200 (CEST) Received: from mosaic02.mosaic.de ([127.0.0.1]) by localhost (mosaic02 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07803-06; Thu, 30 Sep 2004 12:14:18 +0200 (CEST) Received: by mosaic02.mosaic.de (Postfix, from userid 10) id 51E4091FE0; Thu, 30 Sep 2004 12:14:18 +0200 (CEST) Received: from [172.17.1.87] (aupc287.mosaic-ag.com [172.17.1.87]) by mailsrv.mosaic-ag.com (Postfix) with ESMTP id 901655625F; Thu, 30 Sep 2004 12:13:09 +0200 (CEST) Message-ID: <415BDC35.1020801@mosaic-ag.com> Date: Thu, 30 Sep 2004 12:13:09 +0200 From: Roland Walter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7.2) Gecko/20040803 X-Accept-Language: de-DE,de,en MIME-Version: 1.0 To: Tim Penhey Cc: "pgsql-jdbc@postgresql.org" Subject: Re: PreparedStatement.setString with null References: <415BD807.6040103@penhey.net> In-Reply-To: <415BD807.6040103@penhey.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavis at mosaic-ag.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/210 X-Sequence-Number: 11100 Tim Penhey schrieb: > What is this supposed to do? > > PreparedStatement stat = connection.prepareStatement("update table1 > set col1 = ?"); > stat.setString(1, null); > > Will this make a null value in the database or an empty string? Do we > have to use the setNull(1, Types.VARCHAR) in order to get a null value > entered? If you want to be portable to different databases, use the setNull() method. -- Roland Walter MOSAIC SOFTWARE AG Telefon: 02225/882-411 Fax: 02225/882-201 http://www.mosaic-ag.com