This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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'.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with sequence
 
Similar Threads
Use sequence or select max(field) from table to get next id?
Alternate flows -- sequence diagrams
Is it necessary to draw the picture of jsp for part II?
sequence diagram with actor
"JSF compliant" diagram for component diragam