Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problems with nextval and currval calling JAVA and Oracle 9i
On 22 Jan 2004, info_at_agrv.de wrote:
> The problem is, that i can get the nextval but not the
> currval. To get these values I'm using these calls:
>
> int fid_nextval = SequenceBean.getNextval_fid();
> int fid_currval = SequenceBean.getCurrval_fid();
>
> Here I get the Value for fid_nextval but no value for
> fid_currval.
>
> Some Ideas to handle these problem ?
You didn't show where you were asking for currval, but you did show two methods, both establishing a connection. Currval only works when you ask for it on the same connection that previously asked for nextval.
I'd suggest opening up a couple of sqlplus session and playing with nextval/currval calls making sure you understand how they work. Then, coding java around it will be simple.
-- Galen BoyerReceived on Thu Jan 22 2004 - 22:00:13 CST