Search Postgresql Archives

Re: parameter passing from java program

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

 





On Mon, 15 May 2006, dfx wrote:

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(?)}";


You're mixing your calling syntax.  You need to write either:

conn.prepareCall("{ ? = call ins_congressoa(?)}");

or

conn.prepareStatement("SELECT ins_congressoa(?)");

Kris Jurka


[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