Search Postgresql Archives

parameter passing from java program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux