pg.ddx.io  pljava-dev@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Problem with jdbc driver
Date: Fri, 17 Sep 2004 13:18:52 +0200
Message-ID: <thhal-0nmAmAjmaUykj3wxrLc2dGojSGNQO1L@mailblocks.com> (raw)
In-Reply-To: <1095364686.2894.29.camel@wrk68.caminosca.com>
References: <1095358292.2894.11.camel@wrk68.caminosca.com>
	<4149E74E.5030606@mailblocks.com>
	<thhal-00H8lApeRUykpCG+2lBXjsCA4Zmi3UK@mailblocks.com>
	<1095364686.2894.29.camel@wrk68.caminosca.com>
	<414AC81C.7090702@mailblocks.com>

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







view thread (4+ messages)  latest in thread

Message-ID: <thhal-0nmAmAjmaUykj3wxrLc2dGojSGNQO1L@mailblocks.com>
Permalink:  ../thhal-0nmAmAjmaUykj3wxrLc2dGojSGNQO1L@mailblocks.com/
Also on:    postgresql.org/message-id/thhal-0nmAmAjmaUykj3wxrLc2dGojSGNQO1L@mailblocks.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] Problem with jdbc driver
  In-Reply-To: <thhal-0nmAmAjmaUykj3wxrLc2dGojSGNQO1L@mailblocks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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