Hello, Im developing an application where a suer can search by username, password or email..while username must be unique, pswd n email can return multiple users. I know how to display the row if it returns only one user. Vector vmembers = new Vector(); if((vmembers.size() == 1 ))) user = (User) vmembers.elementAt(0); But, how do i display all the users if more than 1 record matches the search(vmembers.size() > 1)??. Any help would be greatly appreciated. thanks
How are you displaying the results? Is this a Swing-based application or a JSP-based application? If it's Swing based, then you will probably want a JTable using a TableModel. Update the TableModel with your results list and the Table should populate. (See the Swing forum for more questions on that...) If it's JSP based, simply iterate through the list and display the results of each record in turn. See the JSP/Servlet forums for more information on doing this. (And strongly consider using a List instead of a Vector, BTW). Hope that this helps,
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Joined: Jun 16, 2003
its a servlet based application. Thats what my problem is..i don't know how to extract the records one at a time from the Vector(if there are multiple records). Any help would be appreciated...