下拉列表从数据库取值问题~~
想从数据库调取数据放进下拉列表中,下面是代码。但是总是取不到值。
求大神解释~~
<select id="example" name="example">
<option value="请选择" selected="selected">请选择</option>
<%ResultSet rs1=null;
String str1="select distinct exdate from note";
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con1 = DriverManager.getConnection("jdbc:oracle:thin:@132.232.36.137:1521:manage", "server","server");
Statement stmt1 = con1.createStatement();
rs1= stmt1.executeQuery(str1);
%>
<%while(rs1.next())
{%>
<option value="<%=rs1.getString("EXDATE") %>" ></option>
<%}
%>
</select></td>