db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Criteria doesn't work with PG 8.0 (although works with PG 7.3)
Date Fri, 10 Jun 2005 07:40:02 GMT




Could you please open a scarab issue on that ?

 Thanks,

     Thomas

"Nikhil G. Daddikar" <ngd@celoxis.com> schrieb am 09.06.2005 09:48:57:

>
> If you have the following simple criteria:
>
> Criteria c = new Criteria();
> c.add("work.percent_complete", 100, c.LESS_THAN);
>
> it doesn't work on PG 8.0 but works on 7.3.
>
> The reason is that in Criterion.appendPsTo, it calls:
>
>     params.add (value.toString());
>
> and consequently on the preparedStatement setString is called.
>
> Read this for more info:
> http://archives.postgresql.org/pgsql-jdbc/2005-03/msg00060.php
>
> In PG 7.3, the protocal version is V2 while in 8.0 is V3. In fact you
> can still get the stuff to work in 8.0 if you specify
> "protocolVersion=2" in the jdbc URL. However, I think this is a serious
> issue and  is not a long term solution and might break other databases
> in the future.
>
> SOLUTION:
> I think the solution is not to call the "toString" in appendPsTo AND use
> setObject in the prepared statement. I don't know if this works with all
> databases.
>
>
>
>
>
>
>
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message