Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2012
    Rep Power

    Default insert into database from struts

    hi i m new to struts. also i have started to develop struts framework based applications.
    now actually my requirement is that i have to insert into database from many jsp pages.
    how to achieve this.
    for example i have employee master from where i ll insert/add new employee,
    next purchase master from where i ll insert/add new purchase details,
    at last sales master from where i ll insert/add new sales details

    i can do this by having three separate class for inserting into three different tables,
    but my requirement is that i should use a common class or jsp page to insert data from many number of pages.
    please provide me any tutorial/link from where can i learn about this and implement it.

    thanks and regards

  2. #2
    Maya Patel is offline Member
    Join Date
    Sep 2012
    Rep Power

    Default Re: insert into database from struts


    try this.....

    create three class for three pages
    now create one common class which has a object of this three class employee,purchase and sales

    now before you load first page employee detail create object of EmployeeDetails class and put this object in session.
    before u navigate next page submit this details to server and set this employee details to session variable and again put this
    object to session. again before u navigate last page sales set again all purchase details in this session variable

    last when u submit last page then you have both pages detail employee and purchase in session

Similar Threads

  1. Create registration form | insert into database | call the database
    By FamilyGuy in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 04-23-2012, 11:08 AM
  2. insert vector to database
    By jperson in forum JDBC
    Replies: 4
    Last Post: 01-20-2011, 03:42 AM
  3. how to insert data in database
    By Vinay Bhatia in forum JDBC
    Replies: 6
    Last Post: 11-03-2010, 05:06 PM
  4. why i can't insert data to database
    By khaa_khay in forum Web Frameworks
    Replies: 0
    Last Post: 05-26-2010, 05:37 AM
  5. Replies: 3
    Last Post: 02-28-2009, 10:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts