Skip site navigation (1) Skip section navigation (2)

Re: postgresql and java data types mismatch.....

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Andres Ledesma <aledes(at)euskalnet(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: postgresql and java data types mismatch.....
Date: 2005-08-11 13:32:46
Message-ID: 42FB537E.4070005@opencloud.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Andres Ledesma wrote:

> According to documentation, java.sql.Types.BOOLEAN is the equivalence of SQL 
> BOOLEAN, but a function returning a boolean, returns something matched to 
> Types.BIT in java.  It happens in the following code.

Types.BIT and Types.BOOLEAN are, as far as I can tell from the JDBC
spec, intended to be interchangeable.

> A CallableStatement Function was executed and the return was of type 
> (java.sql.Types=-7) however type=java.sql.Types=16 was registered.
> 
> Types = -7 correspond to Types.BIT
> Types = 16 correspond to Types.BOOLEAN

A workaround is to just register the OUT parameter as Types.BIT, but
yes, the driver shouldn't really complain in this case.

You didn't say which driver version you were using..

-O

In response to

Responses

pgsql-jdbc by date

Next:From: Andres LedesmaDate: 2005-08-11 13:49:02
Subject: Re: postgresql and java data types mismatch.....
Previous:From: Andres LedesmaDate: 2005-08-11 13:23:42
Subject: postgresql and java data types mismatch.....

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group