• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to retrieve value from autogenerated(oracle sequence) column in a servlet.  RSS feed

 
Bhardwaj Shweta
Ranch Hand
Posts: 36
Eclipse IDE Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello

In my servlet i want to retrieve values from my jsp form,however there is one column in my table (created using sequence )so that it can increment automatically .



Now what should i write for first column?
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I think you can either pass in null or you can omit the first placeholder [?] from the prepared statement. I'm sure one of these will work.

Sean
 
Bhardwaj Shweta
Ranch Hand
Posts: 36
Eclipse IDE Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Sean Thanks
It worked when i replaced first placeholder with (seq_auto.nextval)

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!