GeeCON Prague 2014*
The moose likes JDBC and the fly likes problem with sequence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem with sequence " Watch "problem with sequence " New topic
Author

problem with sequence

gvasu kumar
Greenhorn

Joined: Jul 19, 2005
Posts: 6
hi all,
in my application i am using the Oracle Sequence for generating the sequence of numbers.how can i invoke the sequence from the JDBC.
Thanx in advance
gvasu kumar
Greenhorn

Joined: Jul 19, 2005
Posts: 6
sorry i forgot to say i am using preparedstatement
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I believe it is 'select <sequence_name>.next from dual' but I'd have to go check. I'm sure someone will correct me soon if I'm wrong.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Not quite right, it should be 'nextval', not 'next'.
 
GeeCON Prague 2014
 
subject: problem with sequence