Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stumped rt now

 
siddharth sharma
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what does seq.nexval returns when fired from a java program?
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similar behaviour as in database. It will return next value of sequence


Shailesh
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by siddharth sharma:
what does seq.nexval returns when fired from a java program?


You should try it out yourself mate, prior to post questions. In case of wiered result, we are here to guide you through. By practicing this you will surely learn more.

Anyways, you have got the answer.
 
siddharth sharma
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually i framed it wrong i guess.. my problem was that i was not not sure what select seq.nextval returns in java i.e what resultset i get when i fire this query..anyways i got the answer... as u said "try tourself first"...

SQL = "SELECT XSELL_SCRIPTID_SEQ.NEXTVAL FROM DUAL";
while (rs.next())
{
number = rs.getInt(1)+ "";
}
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great. It is really appreciated.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35266
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Siddharth,
Welcome to JavaRanch!

Thanks for posting the solution (code to get the solution) for people who read this thread in the future.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic