I make servlet and in servlet we make dropdown menu for display names against id but when we run the servlet drop down menu created but no values displayed form database in dropdown menu so pls help me. sorry for bad english
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.management.Query;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class DeleteProductServlet extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, SQLException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
DBManager db=new DBManager();
Connection conn=db.getConnection();
Statement stmt=conn.createStatement();
String product1="product";
out.println("<select name='" + product1 + "'>");
String sql="SELECT * FROM TBL_PRODUCTS";
rs=stmt.executeQuery(sql);
while(rs.next())
{
String id=rs.getString("ID");
String name=rs.getString("NAME");
out.println("<option values" +id +name+"</option>");
}
out.println("</select>");
}
finally {
out.close();
}
}
}