Re: DatabaseMetaData and Transactions

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Carl Olivier <carl(at)zero-one(dot)co(dot)za>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: DatabaseMetaData and Transactions
Date: 2005-06-07 21:38:34
Message-ID: 42A613DA.7090300@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Carl Olivier wrote:

> Now - the reason we do a setString(index, null) and not a setNull(index,
> Types.SOME_TYPE) is because this method is generic and does not always KNOW
> the datatypes for the columns.

> ERROR: column "created_by" is of type integer but expression is of type
> character varying

> Does anyone have any comments/suggestions/etc? Is there any way to get
> around this? Or will we need to update our side to always pass in the
> column meta data etc for use?

You're going to have to pass metadata down, or change your queries to
explicitly cast the parameters in the SQL itself. The driver has exactly
the same problem as your code does -- with the v3 protocol it needs to
provide a type for the parameter, but if it's just provided as a string
the only type it can assume is text..

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-06-07 21:42:14 Re: 8.x driver with EJB CMP
Previous Message Sathyajith G 2005-06-07 20:05:28 Re: exception while upgrading driver