hi all,
 I hav a pblm in HTML + JSP form. I want to generate a pulldown menu based
on a Database values dyanmically. Im able to retrive and set the values to a
array. But Im unable to put it in a pulldown menu where it displays null
instead of that value. Im able to understand the pblm y its so but I dont
know how to solve it. Can some one just recode my coding so that I get a
correct output at pulldown menu.



<%@page session="true"%>
<%@page import="javax.servlet.*"%>
<%@page import="javax.servlet.http.*"%>
<%@page import="java.io.*"%>
<%@page import="java.sql.*"%>
<%@page import="java.lang.*"%>

<%
       Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
       Connection con= DriverManager.getConnection("jdbc:db2:track","","");
       Statement stmt=con.createStatement();

       ResultSet rs=stmt.executeQuery("select * from user");
       String[] choose=new String[100];
       int i=0;
       try{
               while(rs.next()){
                       choose[i]=rs.getString("uname");
                       out.println("<BR>"+choose[i]);
                       i++;
               }
       }
       catch(Exception e){}
       out.close();
%>

<html>
<body>
<select name="ld">
<%
   for ( int n = 0; n<i; n++ ) {
       %>
       <option value="<%=choose[i]%>"><%=choose[i]%>
       <%
   }
%>
</select>
</body>
</html>


thanks in advance.
urs,
karthik

_________________________________________________________________
Help STOP SPAM: Try the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

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

http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com

Reply via email to