Hi !
-----Original Message-----
From: Jeetandra Mahtani <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, April 05, 1999 10:07 PM
Subject: Adding records to a database


>Hello,
>I have a form with about a 100 fields and I am going
>to pass this form to a servlet. Can someone give me
>some tips/ideas on how I could efficiently retrieve
>these values and add it to the database.
>Appreciate it.
>Thanks,
>J


I don't know if you have written servlets or no .

I supose you did.

The step are the following:
retieve the 100 form fields with:

String var1=request.getParameterValues("fieldname1")[0];
for field that contain just one data (that is the usuall one).

You should use a String arrar[100] or a Vector what is easier for You


Than you can use your connection to the database
(allready established) and create a Statement.

Statement s=connection.getStatement();
Than ResultSet rs=s.executeQuery("INSERT into tablename........");
                       or         executeUpdate(
Than close rs
And repeat the ResultSet step a 100 times (closing it each time !!)

Than colse s too


If this thing is not too specific let me know.
p.s. if you are new in servlets than this thing won't help you
in that case i cold send you an example .


My best wishes,
                            Andras

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to