how to show data in array format?
Hello,
I have two questions,
1) How to count the no. of records returned by a Query in JSP ie mysql_num_rows(query) is done in PHP and
2) How to put data in array form after retrieving it from the database.
I had done the following code to put in array format.
I have a list of usernames that comes from the database and i need to keep it in the array list.
ie.
I have a query that results more than 10 records. and the result for this is rs.
I have done like this,
String[] user_name = null;
int index = 0;
while(rs.next())
{
user_name[index] = rs.getString("Username");
index++;
}
But this resulted an error in my page. Is anything wrong in my code or can u plz give me the instructions how to keep data in array formats like in above case.
Message was edited by:
yubak123

