>> can we place the Name column from the database to a combo box
What do you mean?
Main Topics
Browse All TopicsHi,
Please kindly assist how can we place the Name column from the database to a combo box?
Thanks.
<%@ page import="java.sql.*" %>
<%@ page import="org.apache.commons
<%@ taglib uri="http://displaytag.sf.
<html>
<head><title>Query Results</title></head>
<body>
<%
Connection connection = null;
Class.forName("com.mysql.j
connection = DriverManager.getConnectio
Statement stmt = connection.createStatement
ResultSet rs = stmt.executeQuery("SELECT ID,Name from employees");
RowSetDynaClass resultSet = new RowSetDynaClass(rs, false);
stmt.close();
connection.close();
request.setAttribute("resu
%>
<display:table name="requestScope.results
</body>
</html>
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Ic, In your case you would simply do:
<%@ taglib prefix="c" uri="http://java.sun.com/j
<select ...>
<c:forEach var="row" items="${requestScope.resu
<c:set var="optionValue" value="${row.Name}" />
<option value="${optionValue}"> ${optionValue}</option>
</c:forEach>
</select>
object,
combo box did appear in the upper left corner with no data inside. I think I may have missed something.
Please kindly assist how can we troubleshoot furthur
Thanks.
<%@ page import="java.sql.*" %>
<%@ page import="org.apache.commons
<%@ taglib uri="http://displaytag.sf.
<html>
<head>
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen, print" />
<title>Query Results</title></head>
<body>
<%
Connection connection = null;
Class.forName("com.mysql.j
connection = DriverManager.getConnectio
Statement stmt = connection.createStatement
ResultSet rs = stmt.executeQuery("SELECT ID,Name from employees");
RowSetDynaClass resultSet = new RowSetDynaClass(rs, false);
request.setAttribute("resu
%>
<select name="combo">
<% while (rs.next()) { %>
<option value="<%= rs.getObject("ID") %>"><%= rs.getObject("NAME") %></option>
<% } %>
</select>
<display:table name="requestScope.results
<display:column property="ID" title="ID" group="1" sortable="true" headerClass="sortable"/>
<display:column property="Name" title="Name" group="2" sortable="true" headerClass="sortable"/>
</display:table>
</body>
</html>
Business Accounts
Answer for Membership
by: CEHJPosted on 2005-10-15 at 04:23:22ID: 15090893
You'll probably have to iterate using jstl