Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drop Down box for Jstl Select query results

 
SP Nam
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jsp page and inside it I have a Select query which gets results for a table. I want to show that results as drop down box on a jsp page.

How to get the results into drop down box on a jsp page.

Any ideas.

Thanks

SP Nam
 
SP Nam
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
This is my code,
any body look in and suggest
SP Name

----------------

<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<html>
<head>
<title>JSTL: SQL action examples</title>
</head>
<body bgcolor="#FFFFFF">

<h1>SQL Update Exec</h1>

<sql:setDataSource

var="example"
driver="oracle.jdbc.driver.OracleDriver"
url="jdbc racle:thin:@insn104a.idc.oracle.com:1522 ra9idb"
user="scott"
password="tiger"
/>

<sql:transaction dataSource="${example}">

<sql:query var="abc">
select emp_id from emp
</sql:query>

</sql:transaction>



<p>Select a Class
<select Name ="ClassDrop">
<c:forEach var="row" items="${abc.rows}">
<option><c ut value="${row.emp_id}" /></option>
</c:forEach>
</select>
<p>

<input type="submit" value="SUBMIT"/>
<input type="reset" value="RESET"/>
</body>
</html>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic