From: thhal at mailblocks.com (Thomas Hallgren) Date: Fri, 17 Sep 2004 13:18:52 +0200 Subject: [Pljava-dev] Problem with jdbc driver In-Reply-To: <1095364686.2894.29.camel@wrk68.caminosca.com> References: <1095358292.2894.11.camel@wrk68.caminosca.com> <4149E74E.5030606@mailblocks.com> <1095364686.2894.29.camel@wrk68.caminosca.com> <414AC81C.7090702@mailblocks.com> Message-ID: Daniel, >My first function f1(Date, Date, int4) calls a java method in the class >'my.package.prc.ActAtv' and returns a boolean. That works fine!! > >My second function f2() calls a java method in the class >'my.package.prc.CrnAtv' and returns a boolean, but in my second class I >have the next code: > >Connection _cn=DriverManager.getConnection("jdbc:default:connection"); >String _sql = "SELECT actity.uid WHERE f1($1,$2,activity.uid); >Here I get the error!! > > I have several examples running where I call SQL from within a Java function and that SQL in turn calls other Java functions. They run without any problem. In your example I see that you use '$1' and '$2' as parameter placeholders instead of the '?' stipulated by JDBC. Could that be your problem? The PL/Java driver will only recognize '?' . An attempt to use your string would give an SQLException with 'Illegal parameter index'. In any case, it would be very helpful to know what the error is, what platform you're using and what versions you have on PostgreSQL, PL/Java, and Java. Regards, Thomas Hallgren