• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

insertion problems

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CREATE TABLE special
(
id serial NOT NULL,
specialname varchar(50),
CONSTRAINT special_pk PRIMARY KEY (id)
)
eg

1 aaa
2 bbb
3 ccc

CREATE TABLE person
(
id serial NOT NULL,
name varchar(60),
qualification varchar(100),
exp int4,
history text,
CONSTRAINT person_pk PRIMARY KEY (id)
)

eg

100 arun
101 ram
103 manoj

CREATE TABLE person_spec_group
(
fk_person int4 NOT NULL,
fk_special int4 NOT NULL,
CONSTRAINT person_spec_group FOREIGN KEY (fk_person) REFERENCES person (id) ON UPDATE RESTRICT ON DELETE RESTRICT,
CONSTRAINT special_spec_group FOREIGN KEY (fk_special) REFERENCES special (id) ON UPDATE RESTRICT ON DELETE RESTRICT
)

eg

100 1
100 2
100 3

101 2
101 3

102 1


special table
to store the specialname
person table to store the details of a person
person_spec_group table to store the ids of special table and id person table

action

from my struts jsp page contain and display details of a person and one list box, it containing a specialname.

when the user click or select on the list box, it may be multiple selection.
then submit, then that time will store id of person and id of special into the person_spec_group table

in this case result is give below
please help me in this problem

eg

100 1
100 2
100 3

101 2
101 3

102 1


How to works this or how to write action class and SQL query?
 
Good heavens! What have you done! Here, try to fix it with this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic