Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JDBC and Relational Databases
how to retrieve value from autogenerated(oracle sequence) column in a servlet.
Bhardwaj Shweta
Ranch Hand
Posts: 36
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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 .
String str1 = request.getParameter("projectname"); String str2 = request.getParameter("premarks"); String str3 = request.getParameter("pcontact"); String str4 = request.getParameter("psponsor"); String str5 = request.getParameter("powner"); String str6 = request.getParameter("ppriority"); pst = con.prepareStatement("insert into prproject values(?,?,?,?,?,?,?)"); pst.setString(2 ,str1 ); pst.setString(3 , str2); pst.setString(4 , str3); pst.setString(5 , str4); pst.setString(6 ,str5); pst.setString(7 ,str6);
Now what should i write for first column?
Regards,
Shweta Bhardwaj
Sean Clark
Rancher
Posts: 377
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
I love this place!
Bhardwaj Shweta
Ranch Hand
Posts: 36
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hey Sean Thanks
It worked when i replaced first placeholder with (seq_auto.nextval)
Regards,
Shweta Bhardwaj
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
String confusion
String == operator
comparing Strings
Can anyone explain what is == and equal( ) ?
equals versus ==
More...