pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgreSQL 8, JDBC 8 and JSTL problems
2+ messages / 2 participants
[nested] [flat]
* PostgreSQL 8, JDBC 8 and JSTL problems
@ 2005-06-22 23:18 Donny Tjandra <dtjandra@pcthome.com>
2005-06-22 23:51 ` Re: PostgreSQL 8, JDBC 8 and JSTL problems Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 2+ messages in thread
From: Donny Tjandra @ 2005-06-22 23:18 UTC (permalink / raw)
To: pgsql-jdbc
I'm having problems with PostgreSQL 8, JDBC driver 8 and JSTL that I'm not
sure how to fix without major rework or reverting to version 7 PostgreSQL
and JDBC driver. JSTL does automatic type conversion that doesn't seem to
work well with PostgreSQL and JDBC driver 8. For example I have function
defined like this in PostgreSQL:
CREATE OR REPLACE FUNCTION get_property_list(text, date, int4, int4)
Then I call the function from JSTL using sql tags like:
<sql:query var="properties">
select *
from get_property_rates(?,?,?,?)
<sql:param value="${firstDate}"/>
<sql:param value="${lastDate}"/>
<sql:param value="${brandLocationId}"/>
<sql:param value="1"/>
</sql:query>
Unfortunately the type mapping somewhere between JSTL, JDBC and PostgreSQL
is broken and I get function not exist errors like:
ERROR: function get_property_rates(character varying, character varying,
integer, character varying) does not exist.
All this worked fine with PostgreSQL 7. I'm not sure how many others out
there run into this issue and how they get around it (maybe create wrapper
functions that takes all text parameters), or if there are plans to add
smarter type mapping in future versions of the driver.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: PostgreSQL 8, JDBC 8 and JSTL problems
2005-06-22 23:18 PostgreSQL 8, JDBC 8 and JSTL problems Donny Tjandra <dtjandra@pcthome.com>
@ 2005-06-22 23:51 ` Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Jowett @ 2005-06-22 23:51 UTC (permalink / raw)
To: Donny Tjandra <dtjandra@pcthome.com>; +Cc: pgsql-jdbc
Donny Tjandra wrote:
> <sql:query var="properties">
> select *
> from get_property_rates(?,?,?,?)
>
> <sql:param value="${firstDate}"/>
> <sql:param value="${lastDate}"/>
> <sql:param value="${brandLocationId}"/>
> <sql:param value="1"/>
> </sql:query>
>
> Unfortunately the type mapping somewhere between JSTL, JDBC and
> PostgreSQL is broken and I get function not exist errors like:
>
> ERROR: function get_property_rates(character varying, character varying,
> integer, character varying) does not exist.
> All this worked fine with PostgreSQL 7. I'm not sure how many others out
> there run into this issue and how they get around it (maybe create
> wrapper functions that takes all text parameters), or if there are plans
> to add smarter type mapping in future versions of the driver.
Search the archives -- it's not really practical to add "smarter type
mapping" (really, less strict typing) at the driver level.
The "right fix" is to fix the parameter types being given to JDBC by the
JSTL layer. I'm not familiar with JSTL -- does <sql:param> let you
specify a parameter type? At the JDBC level you can, so I suppose you
can in JSTL.
BTW it's a driver change, not a backend change, that changed parameter
typing behaviour between 7.x and 8.x, so if you are going to revert you
should only need to revert the driver.
-O
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-06-22 23:51 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-06-22 23:18 PostgreSQL 8, JDBC 8 and JSTL problems Donny Tjandra <dtjandra@pcthome.com>
2005-06-22 23:51 ` Oliver Jowett <oliver@opencloud.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox