peader2001
Programmer
Hello Gurus,<br><br>I am having major problems with this piece of code below.<br><br>I am using JSWDK-1.0.1 and my problem is I am trying to get the selected operating system in the combo box to do a query and print the result but I don't have any idea how to do it. I am a just a beginner with java but I really need this to work.<br><br>Below is the code for the query1.jsp if anyone could please help me I would be very grateful.<br><br>The combo box populates its list from a MS Access database table with for example:<br><br>WIN 95 <br>WIN 98<br>UNIX etc.. <br><br><br><br><br><HTML><br><body><br><br><Form method="post" action="query1.jsp"> <br><p><b>Operating System</b> <br> <select name="select4" ><br> <option selected>Not Selected</option><br> <option value=OperatingSystem> <%Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"%> <br> <%java.sql.Connection conn = java.sql.DriverManager.getConnection("jdbcdbc:JSPQuery"%> <br> <%java.sql.Statement st = conn.createStatement();%> <%java.sql.ResultSet rs;%><%st = conn.createStatement();%> <br> <% rs= st.executeQuery("Select Distinct OperatingSystem From OperatingSystemTable"%> <br> <%while (rs.next()) { %> <%String OperatingSystem = rs.getString("OperatingSystem"%> <br> <%if (OperatingSystem != null){ %> <br> <option value=<%=OperatingSystem%>><%=OperatingSystem%> <%} %> <%}%> <br> </select><br><p> <input type="reset" name="Reset" value="Reset Query"><br></form> <br><br><Form method="get" action="query1.jsp"><br> <br> <%out.println ("Selected"<br>%><br><input type="submit" name="Submit"<br>value="Submit Query"><br></Form><br><br></body><br></HTML><br><br><br><br>Thank you for your time,<br><br>Peter Daly<br><A HREF="mailtodaly@elandtech.com">Pdaly@elandtech.com</A><br>Ireland - Dublin