• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

jsp and jdbc

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..I have jsp page call sucess.jsp. which is basically get data from a form and stors in database. In my all table i created Sequences to generate accountID and stuff. Now when write my sql query..for example:
Insert into('"+accountId_sequence.NEXTVAL+"','"+viral+"'...);
it gives me error that it can find variable call accountID_squence...
SO my question is how can i store data from a form using Sequence from jsp page..
 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi virla
try this out
1)
Insert into.....("accountId_sequence.NEXTVAL"....)
i.e as accountId_sequence is defined in ur database give it in quotes !!!
or u can do this as well
2)
rs=stmt.executeQuery("select accountId_sequence.NEXTVAL from dual");
if(rs.next())
String accountId_seq=rs.getString(1);
and then ur insert stuff ...
Hope this helps u
cheers
Praful
[ March 19, 2003: Message edited by: Praful Thakare ]
reply
    Bookmark Topic Watch Topic
  • New Topic