parameter passing from java program - Mailing list pgsql-general

From dfx
Subject parameter passing from java program
Date
Msg-id 000001c6782a$a7effbc0$fc00a8c0@dfx
Whole thread Raw
Responses Re: parameter passing from java program
List pgsql-general
Dear Sirs,
 
I am spending about 10 hours on little problem: to pass a parameter (text) to a PostgreSQL (v. 8.1 on Win2000). The
relevant code is:
 
java side:
private CallableStatement cs;
cs = conn.prepareCall(INSERT_CONGRESSO);
cs.setString(1, itemCongresso.getCongresso()); //return a String
cs.execute();
...
public static final String INSERT_CONGRESSO = "{SELECT ins_congressoa(?)}"; 
 
PostreSQL side:
CREATE OR REPLACE FUNCTION ins_congressoa(congresso text)
  RETURNS void AS
$BODY$INSERT INTO "Congressi" ("Congresso") VALUES ($1)
$BODY$
  LANGUAGE 'sql' VOLATILE;
ALTER FUNCTION ins_congressoa(congresso text) OWNER TO postgres;
 
With Pgadmin the function work fine, but from java program does not. WHY?
 
Thank you.
 
Domenico

pgsql-general by date:

Previous
From: Kenneth Downs
Date:
Subject: Re: GUI Interface
Next
From: "Dave Page"
Date:
Subject: Re: GUI Interface