• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Update values in database from jsp

 
Ranch Hand
Posts: 91
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have used hibernate, I have a CUSTOMER table, and a USER table.
I have a Customer_user table and a user_customer table used for one to one mapping between other tables.

When an admin registers a user, he selects which customers are to be added to the SHOW_CUSTOMER_LIST of that user.

For ex, user 1 is authorized to view customer 1 and 2, while user 2 is authorized to view customer 2 and 3. These two are mapped by the ID in their respective CUSTOMER and USER tables.

Cust_user looks something like this :

userID | customerID
1 | 1
1 | 2
2 | 2
2 | 3 and similarly the user_customer table

Now what I want is, that the admin can update these tables, for example if a new customer is added to the database, the admin can update any user to have access to that customer from the jsp page itself, either using multiple select drop down menu or checkbox. What approach should I use for this. Any help would be appreciated.
Thanks in advance.
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you have two mapping tables?
Wouldn't the one be sufficient, as that allows for the many-to-many mapping that you are modelling?
 
arushi tomar
Ranch Hand
Posts: 91
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am actually new in all this and trying to develop an app, I am trying to do this :

Using two tables that are Customer and User, update customer list then get the User object for which I have to update the customer list and add new customers to the list. And also update the customer by adding this particular user to the user list in customer object. But I am not sure how to do this practically. I know the approach but not how to work towards it.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic