hi,

one way is to create a PreparedStatement like this:

SELECT name, age FROM student WHERE stud_no = ?

then stud_no.length tells you, how much values are there
now you can execute the PreparedStatement in a for loop

Other way is to use a normal SQL-Statement, which creates the WHERE-Cause
by appending the entered Values

like:

StringBuffer sql = new StringBuffer("SELECT name, age FROM student WHERE
stud_no IN (");

for(int i=0; i<stud_no.length; i++)
{
sql.append(stud_no[i]);
sql.append(",");
}

U got to have to remove last "," from buffer and append closing bracket
then u got your sql-statement

i think this may be more performant, but i am not sure


Hope this helps

greetings

MD

--
Sent through GMX FreeMail - http://www.gmx.net

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to