• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

storing dynamic row value to database

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application i have a view page(html or jsp) with three field (name,address,roll no).i have one add button ,if i click on add button one java-script will be called and it will display a row in the same page with three column (name,address and roll no).whenever i will click on add button ,a new row will be added.Now i want to store these dynamic row's value to database (using servlet).How can i do this?
 
Marshal
Posts: 67280
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Store it when? When the form is submitted? As soon as the row is added to the display? Please be more explicit in your questions. Read this for more information.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to store when form is submitted.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What part are you having trouble with, retrieving parameters, JDBC?
 
sahid ul karim
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having problem to store it in data base,because every column may have multiple rows.So how can i pass it to the servlet.
Ex:-
Name|Address|Roll no
sahid|blr|259
smith|ger|334
alex|swd|423

Now i want to pass these 3rows to the database through servlet.I know that for a value i can do it using request.getparameter("");but here the values are dynamic.How can i do it?
 
Bear Bibeault
Marshal
Posts: 67280
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are the dynamic values being generated? Your param generator should produce names that the submitting servlet can deal with. One tactic could be to produce names that contain the row index. E.g. "name[0]" "name[1]" and so on. These are easily parsed on submission.
 
machines help you to do more, but experience less. Experience this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!