see my query is like this
(select studentname from student where studentid='+studentid+')

then i display in jsp like this
st_16 //studentid
.nikki //student names
.nani //student names
now second time when i add select student id st_17
now jsp i have display like
st_16
.nikki
.nani //first id's name + second id name's
st_17
.kutti
.abhi

if i add third id
i have to get all 3 id's with its corresponding name's

can anyone tell me how to write code
in while (rs.next())

//after you execute the query

while (rs.next()){
System.out.println(rs.getString("studentid"));
System.out.println(rs.getString("studentname"));
}

--------------------------------------------------------
I hope this is what you meant in your message.

if not just tell me and i will try to think of something else.

Cao

//after you execute the query

while (rs.next()){
System.out.println(rs.getString("studentid"));
System.out.println(rs.getString("studentname"));
}

--------------------------------------------------------
I hope this is what you meant in your message.

if not just tell me and i will try to think of something else.

Cao

no ,
actually i am starting with jsp file i have a text box where i give student id like st_16 ok then it goes to servlet & bean & come to a next jsp file

next time in text box i give st_17 id now i have get
st_16
.nikki
.nani
st_17
.kutti
.chinnu
ok

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.