• 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
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Struts Form Submission. Multiple "Insert" Statements.

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem with struts form-submission.

I want to insert entries to a DB using a form. The form looks something like this.

1. Entry 1 [submit]
2. Entry 2 [submit]

The number of rows is dynamic.Every row has a "Submit" button. When the user hits the button, the DB is updated with the row's data. This is done via an ActionForm, which will pass the parameters to the db via a single SQL insert statement. All this works (for a single row "insert")

What I want to achieve is for the user to amend the entries, then hit a single submit button, to insert all the rows' data in one go, like so

1. Entry 1
2. Entry 2

[Submit All]

How can i achieve this? Is there a way to loop through the entries, doing the "insert" statement multiple times (depending on the number of rows on my table?). The "Insert" statement works for only one row. I do not wish to change the insert statement. The main problem is that the number of rows is not-fixed.

If anyone can point to me a similar solution online, it'll be mightly fine. Thanks!
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Struts forum...
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StrutsCatalogLazyList
 
It's exactly the same and completely different as 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!