tags:

views:

68

answers:

1

Hello,
My question is: How can I access row information using index in JSTL? i am using MySQL 5.1.47 Server as Relational Database Server

For example,
I have a table name login with two attributes “username” & “password” and this table contain 10 records. I want to extract only first record information. How can I do this? I have checked on many website and could find only one way to iterate through table using For Each Tag, as follow

<c:forEach var="row" items="${query1.rows}">
<c:set var='dbUserName' value="${row.loginID}"/>  
<c:set var='dbUserPassword' value="${row.password}"/>  
</c:forEach>  

Using For Each is not helpful in accessing row information by index. Kindly Suggest or let me know if there is a very good resource on JSTL Database funcationality.
Thanks in advance

A: 

Depending on the backing object, you can probably use a simple array index, such as:

${query1.rows[0].loginID}
desau