• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Drop Down box for Jstl Select query results

 
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>
    Bookmark Topic Watch Topic
  • New Topic