nulls in sql and jdbc

From: J Joubert <cs344(at)joubert(dot)me(dot)uk>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: nulls in sql and jdbc
Date: 2003-10-19 13:43:40
Message-ID: 1066571020.3f92950cd7df4@bach.sun.ac.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

How exactly do I use nulls in sql and java?

What I mean is, when I want a column in my database to be set to null, can I
just use
prepStmt.setString(1, null)
and would this work for setting columns of any type?

Conversely, for reading values in that are a null in sql, could I for example
say
String str = resltSet.getString("columnName");
if (str.equals(null))
{
....
}
and again, is this valid for any type in java or sql?

_______________________________________________________________________
All the good things in life are either illegal, immoral or fattening.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marcin Jekot 2003-10-20 08:46:11 Re: nulls in sql and jdbc
Previous Message Ashwin Kutty 2003-10-17 14:54:19 Setting up DSPACE for Postgres access