aspose file tools*
The moose likes Servlets and the fly likes storing dynamic row value  to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "storing dynamic row value  to database" Watch "storing dynamic row value  to database" New topic
Author

storing dynamic row value to database

sahidul karim
Greenhorn

Joined: Sep 19, 2006
Posts: 28
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

Joined: Jan 10, 2002
Posts: 60053
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sahid ul karim
Greenhorn

Joined: Jun 06, 2007
Posts: 20
i want to store when form is submitted.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What part are you having trouble with, retrieving parameters, JDBC?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
sahid ul karim
Greenhorn

Joined: Jun 06, 2007
Posts: 20
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

Joined: Jan 10, 2002
Posts: 60053
    
  65

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: storing dynamic row value to database
 
Similar Threads
Regarding dynamic table generation
selecting a table row with 3 columns and sending it to another page.
Problem i am facing here................
JSP- finding the table row selected
paging for dynamic rows