PreparedStatement.setString with null

From: Tim Penhey <tim(at)penhey(dot)net>
To: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: PreparedStatement.setString with null
Date: 2004-09-30 09:55:19
Message-ID: 415BD807.6040103@penhey.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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?

Thanks,
Tim

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Roland Walter 2004-09-30 10:13:09 Re: PreparedStatement.setString with null
Previous Message Kris Jurka 2004-09-30 09:52:03 Re: Download source code for pg74.215.jdbc3 driver