From: | Oliver Jowett <oliver(at)opencloud(dot)com> |
---|---|
To: | Franco Bruno Borghesi <franco(at)akyasociados(dot)com(dot)ar> |
Cc: | Kris Jurka <books(at)ejurka(dot)com>, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: Question |
Date: | 2004-11-13 22:51:53 |
Message-ID: | 41969009.2040804@opencloud.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Franco Bruno Borghesi wrote:
> As you see, in my current code I have no way to know to which datatype
> the field maps to. So, is there any easy/generic way to set NULLs, no
> matter what datatype the field is?
No. The driver has exactly the same problem as you ran into, namely that
there's no way to infer a type given just a bare null.
You should provide a SQL Types value via setNull(i,type) or
setObject(i,null,type). You may want to change your API to pass down
type information when you are dealing with nulls.
The backend does have a mechanism to infer the type of a parameter, but
it's sufficiently unpredictable for arbitary queries that we decided not
to use it in the driver, given that the rest of JDBC is quite strongly
typed.
-O
From | Date | Subject | |
---|---|---|---|
Next Message | Guido Fiala | 2004-11-15 15:25:58 | Why is PGStream.flush() taking so much time? |
Previous Message | Franco Bruno Borghesi | 2004-11-13 18:25:10 | Re: Question |