Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

storing dynamic row value to database

 
sahidul karim
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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
sahid ul karim
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to store when form is submitted.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic