help with JSP and MySQL forms... A TRICKY ONE

Hi,

I need some help. I need a way of entering data into a column in MySQL. However its not as simple as this. The following is an example of what i want it to do and would apprciate any suggestions.

Example... THERE ARE 3 TEXTFIELDS ON THE FORM (AUDIO,VISUAL AND KINETIC). MAXIMUM NUMBER A PERSON CAN ENTER FOR EACH TEXTFIELD IS 13. IN TOTAL THAT IS 39. IN THE MYSQL COLUMN, THIS NUMBER WILL BE DISPLAYED AS "Y". E.G. IF A PERSON ENTERS 3/13 THEN THERE IS 3 "Y"s AND 10 "N"s. IN EACH MYSQL COLUM THERE WILL BE 30 CHARACTERS EITHER Ns OR Ys.

so if a person enters 4/13 FOR VISUAL, 3/13 AUDIO, 2/13 KINETIC IN THE TABLE I WANT IT DISPLAYED AS

YYYYNNNNNNNNNYYYNNNNNNNNNNNNNYYNNNNNNNNNNN

FIRST 13 CHARACTERS ARE VISUAL, 2ND 13 ARE AUDIO AND 3RD 13 ARE KINETIC. HOWEVER I WANT EACH ONE TO GO IN A SPECIFIC ORDER, SO IF 3/13 IS CHOSEN THEN IT SHOULD BE AS FOLLOWS

NNNYNYNYNNNNN SO THATS ONE "Y" IN 4TH CHARACTER, ONE "Y" ON 6TH CHARACTER AND ONE "Y" IN 8TH.

PLEASE PLEASE ANYONE HELP.... ALL I NEED TO DO IS SLOT A "Y" INTO A STRING OF 13 CHARACTERS... MAKE THE REST "N"s AND THEN ADD THE STRING INTO MYSQL...

THANK YOU

[1170 byte] By [fahafiza] at [2007-11-27 11:14:35]
# 1

Don't TYPE IN ALL CAPS; this is read as shouting and considered rude.

~

yawmarka at 2007-7-29 14:07:45 > top of Java-index,Java Essentials,New To Java...
# 2

ah sorry.... java has frustrated me lol

fahafiza at 2007-7-29 14:07:45 > top of Java-index,Java Essentials,New To Java...
# 3

> Don't TYPE IN ALL CAPS; this is read as

> shouting and considered rude.

Besides, it already hurts the eye just to look at it. Even more than seeing "JSP" and "MySQL" in one headline.

CeciNEstPasUnProgrammeura at 2007-7-29 14:07:45 > top of Java-index,Java Essentials,New To Java...
# 4

> ah sorry.... java has frustrated me lol

Understandable, but you don't want to pass that frustration on to the volunteers who would help you solve your problem for free, do you?

~

yawmarka at 2007-7-29 14:07:45 > top of Java-index,Java Essentials,New To Java...
# 5

>

> Example... THERE ARE 3 TEXTFIELDS ON THE FORM

> (AUDIO,VISUAL AND KINETIC). MAXIMUM NUMBER A PERSON

> CAN ENTER FOR EACH TEXTFIELD IS 13. IN TOTAL THAT IS

> 39. IN THE MYSQL COLUMN, THIS NUMBER WILL BE

> DISPLAYED AS "Y". E.G. IF A PERSON ENTERS 3/13 THEN

> THERE IS 3 "Y"s AND 10 "N"s. IN EACH MYSQL COLUM

> THERE WILL BE 30 CHARACTERS EITHER Ns OR Ys.

> so if a person enters 4/13 FOR VISUAL, 3/13 AUDIO,

> 2/13 KINETIC IN THE TABLE I WANT IT DISPLAYED AS

> YYYYNNNNNNNNNYYYNNNNNNNNNNNNNYYNNNNNNNNNNN

> FIRST 13 CHARACTERS ARE VISUAL, 2ND 13 ARE AUDIO AND

> 3RD 13 ARE KINETIC. HOWEVER I WANT EACH ONE TO GO IN

> A SPECIFIC ORDER, SO IF 3/13 IS CHOSEN THEN IT SHOULD

> BE AS FOLLOWS

> NNNYNYNYNNNNN SO THATS ONE "Y" IN 4TH CHARACTER, ONE

> "Y" ON 6TH CHARACTER AND ONE "Y" IN 8TH.

These requirements are crazy.

Are you going to keep a map with all permutations and convolutions? Why are you doing this in this manner at all? The database design is emitting a foul and unpleasant odour to be honest with you.

cotton.ma at 2007-7-29 14:07:45 > top of Java-index,Java Essentials,New To Java...
# 6

yes ur right, its a stupid way of populating a database... but i didnt create it....

the Ys and Ns are all entered by a questionnaire with 39 questions...

hence 39 Ys and Ns... all i need to do is figure a way of entering Ys and Ns in a sequence into a database...

at the moment, theyre pulled out from a database in a sequence manner... will this code help?

fahafiza at 2007-7-29 14:07:45 > top of Java-index,Java Essentials,New To Java...