Re: Question
От | Oliver Jowett |
---|---|
Тема | Re: Question |
Дата | |
Msg-id | 41969009.2040804@opencloud.com обсуждение исходный текст |
Ответ на | Re: Question (Franco Bruno Borghesi <franco@akyasociados.com.ar>) |
Список | 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
В списке pgsql-jdbc по дате отправления: