How can I insert the multiple values for a single column within a loop in JSP?

patelsuni
patelsuni used Ask the Experts™
on
When I click on submit button, I need to insert the multiple rows. I tried to put the insert statement within While loop like WHile rs.next(){
}

But rs is not as resultset. It stores the resuklts return by the query using getQueryResults. How can I iterate through the entire set of values and insert them.

I'll really appreciate if anyone can help me in this.

Thanks
Nimisha
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
I am not sure I follow the flow.

Can u outline what you are trying to do.

You should be able to loop through a collection and run sql updates using jdbc.

CJ
Mick BarryJava Developer
Top Expert 2010

Commented:
bit hard to help without seeing your code.
post your code and we'll help fix it.

Author

Commented:
Thanks for getting back to me.
Actually I was able top make it work. I put the Insert statement in a While loop ,thereby I was able to store a multiple values for a sinlge column.
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Author

Commented:
Thanks for getting back to me.
Actually I was able top make it work. I put the Insert statement in a While loop ,thereby I was able to store a multiple values for a sinlge column.

Commented:
ok.  Please ask Community Support to either PAQ this question or delete it.

CJ
Distinguished Expert 2018

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQed and points NOT refunded.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
Commented:
PAQed - no points refunded (of 50)

modulo
Community Support Moderator

Commented:
Sorry for the late comment, but the user solved their own problem, shouldn't pts be refunded?

CJ

Commented:
Thnx for clarifying.

CJ

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial