Re: Problem asking columns allowing NULL values - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: Problem asking columns allowing NULL values
Date
Msg-id 1049820228.1790.89.camel@inspiron.cramers
Whole thread Raw
In response to Problem asking columns allowing NULL values  (. <alzina@inicia.es>)
Responses Re: Problem asking columns allowing NULL values
List pgsql-jdbc
Can you send me a small test program to demonstrate the problem?

Dave
On Tue, 2003-04-08 at 13:23, . wrote:
> Hello,
> I'm trying to ask a PostgreSQL server, using its JDBC driver, if the columns of
> a table allow NULL values. To do so, I look at the value of the field
> columnNullable (class ResultSetMetaData). Simply put, if I have a ResultSet
> "rs" filled with rows from a query, I do the following:
>
>
>
> ResultSetMetaData rsmeta = rs.getMetaData();
>
>    if (rsmeta.columnNullable == 1)
>     System.out.printl("null values allowed");
>    else
>     System.out.printl("null values NOT allowed");
>
>
>
> The result says that *all* columns allow NULL values, although I've defined
> several of them with the clause "NOT NULL" (I've checked that this columns does
> really not allow NULL values, trying INSERT statements with psql).
>
> I'm using the last stable release of the JDBC driver. Somebody else have
> suffered the same problem? Or I'm doing something wrong? I'd be very grateful
> if somebody could help me.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
--
Dave Cramer <Dave@micro-automation.net>


pgsql-jdbc by date:

Previous
From: .
Date:
Subject: Problem asking columns allowing NULL values
Next
From: "Sohail A. Khan"
Date:
Subject: JDBC