From: Roland Walter <rwa@mosaic-ag.com>
To: Tim Penhey <tim@penhey.net>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: PreparedStatement.setString with null
Date: Thu, 30 Sep 2004 12:13:09 +0200
Message-ID: <415BDC35.1020801@mosaic-ag.com> (raw)
In-Reply-To: <415BD807.6040103@penhey.net>
References: <415BD807.6040103@penhey.net>
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
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: rwa@mosaic-ag.com, tim@penhey.net
Subject: Re: PreparedStatement.setString with null
In-Reply-To: <415BDC35.1020801@mosaic-ag.com>
References: <415BD807.6040103@penhey.net> <415BDC35.1020801@mosaic-ag.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