FW: Postgres 8.1 sequences and 'CALL'-syntax

From: "Schnabl, Sebastian" <s(dot)schnabl(at)qualitype(dot)de>
To: <pgsql-general(at)postgresql(dot)org>
Subject: FW: Postgres 8.1 sequences and 'CALL'-syntax
Date: 2006-04-27 11:13:38
Message-ID: CE99C61B73E843438E690CBE9C63A5AF7323AC@srv02.dresden.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Connection conn = ...
> CallableStatement cs = conn.prepareCall("{? = call
> nextval('seq_nm')}"); cs.registerOutParameter(1, Types.BIGINT);
> cs.execute(); long nextval = cs.getLong(1); cs.close();

Yeah, it seems to work, if i change the definition for calling the sequence in conjunction with sequoia trough jboss change into: "{call nextvalue('seq_name')}" [the "{}" pair is important !] and use the "org.postgresql.jdbc3.Jdbc3PooledDataSource" driver class.

Many Thx !

Browse pgsql-general by date

  From Date Subject
Next Message Geoffrey 2006-04-27 12:09:39 Re: Mailing list setup issue
Previous Message Kenneth Downs 2006-04-27 11:05:00 Re: SQL Rule