Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)?

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)?
Date: 2007-03-02 01:39:50
Message-ID: 45E78066.6000604@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Tom Lane wrote:
> Dave Cramer <pg(at)fastcrypt(dot)com> writes:
>> On 1-Mar-07, at 7:06 PM, Tom Lane wrote:
>>> At least in this particular case, leaving the parameter type as
>>> UNKNOWN
>>> would have worked as the OP wishes. I dunno if that would break other
>>> cases though.
>
>> This means you have to leave all parameter types as UNKNOWN. What's
>> the point of having parameter types at all ?
>
> No, only the ones you do not have any knowledge about. The OP's
> complaint is basically that the driver is forcing the parameter type
> to "varchar" on the basis of nothing whatsoever.

I didn't see the OP say what JDBC calls are being made so I think you're
jumping the gun here. If the EJB3 layer is calling something like
setString(n, null) then the driver is quite justified in assuming the
parameter is varchar. I don't think the driver ever goes from "I don't
know the type" to "the type is varchar" .. if anything, it has to do the
opposite to deal with applications that think that setString() on a
numeric column is a sensible thing to do :(

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2007-03-02 01:41:39 Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)?
Previous Message Dave Cramer 2007-03-02 01:15:25 Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)?