Hi guys pls check this this is my code For poulating menu in jsp
Hi iam gettin one dropdown box in output but data from the table is not getting displayed will u pls solve this remedy
Hi guys pls check this this is my code
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="">
<select name="select">
<%Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:Shoy");
Statement st = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
String prepJSQL = "select SUB_CAT from facilitypt";
PreparedStatement ps= con.prepareStatement(prepJSQL);
System.out.print(prepJSQL);
ResultSet rs = ps.executeQuery();
try {
while(rs.next()){
String jusersql = rs.getString(1);
System.out.println(jusersql);
%>
<option value="<%=jusersql%>"></option>
<%
}
%>
</select>
<%
}
catch (SQLException sqlex){//1st catch
sqlex.printStackTrace();
log("SQLException", sqlex);
}
catch(Exception ex){
ex.printStackTrace();
}
rs.close();
st.close();
%>
</form>
</body>
</html>

