Indeed. Please format your posts to make easily readable.
As for your question, what I understand is that you have a
Servlet in which you received and process 40 query string items and you'd like to store the values in a database where the same keys exist. So far you've parsed the key-value pairs into an Array. If this is correct,
in the simplest form, you'll ought to create a middle tier class in which you use
JDBC to connect to your database and execute an UPDATE command. I recommend using database stored procedures instead of writing the SQL command in your database.