<html:select styleId="selectedop" property="selectedop" onchange="javascript:submitit();" value="select"> <html:option value="--select--">--select--</html:option> <% try { //to connect need wifi (since public ip) //String url = "jdbc:mysql://dbno2.ce6zvdgnoq7r.ap-southeast-2.rds.amazonaws.com:3306/INVENTRY?user=aghil&password=password1"; String url = connectionString; Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection(url); ResultSet rs; PreparedStatement pst = con.prepareStatement(selectQuery); rs = pst.executeQuery(); while (rs.next()) { String name = rs.getString(1); %> <html:option value="<%=name%>"><%=name%></html:option> <% }%> <% } catch (Exception e) { out.print(e); } %> </html:select>
private String selectedop;
value
html:select
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)