Forums Register Login

How to insert value in a table using session(ArrayList)?

+Pie Number of slices to send: Send
Hi all,

This is my servlet and I want to add values in a table using this servlet but I am facing a problem how to set an ArrayList object in pst.setString ???

Please suggest me and Thank you in advanced

code is here


in ar1 values are accorate and ar2 also but I am anable to set these values in pst.setString ....so please clear it...


Thanks once again!!!
+Pie Number of slices to send: Send
 

Rd Dari wrote:This is my servlet and I want to add values in a table using this servlet but I am facing a problem how to set an ArrayList object in pst.setString ???



Well, you wouldn't. If "pst" is a PreparedStatement then its setString() method requires a String as the second parameter. So asking how to pass an ArrayList there doesn't make any sense. You should review your requirements to find out where that String is supposed to come from.

And just another piece of advice: if you are still working on basic Java or JDBC programming, then a servlet is going to be a very inconvenient test environment. Do your training and practicing in a plain old Java application. Then after you have working code, take that code and insert it into your servlet.
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3034 times.
Similar Threads
GET Method Working But POST is not
To compare 2 list and obtain the unmatched values from the list
To compare 2 list and obtain the unmatched values from the list
How to configure Bonecp in java project without breaking connection when more than connection
regarding pdf Creation using iText
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:55:51.