JSP Database Dropdown Population - Newbie, please help

F

frawls

Hi,

I am having problems populating a dropdown list in a jsp page with
mulitple entries from a database. Can anyone please help me with the
code or point me in the right direction. Im am using the oreily custom
tags. The page is as follows.

<%@ page language="java" contentType="text/html" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ora.jsp.util.*" %>
<%@ taglib uri="/orataglib" prefix="ora" %>

<HTML>
<BODY>
<ora:sqlQuery id="sqlAdminDropdown" dataSource="AileenDB"
scope="session">
SELECT AdminName From Aministrator
</ora:sqlQuery>
<TABLE>
<TR>
<TD>
** Need to put the dropdown populated with ALL the
AdminName here **
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

I have tried things like the following but dont have a clue:

<html:select name="session">
<html:eek:ptionsCollection name="sqlAdminDropdown"
property="sqlAdminDropdown" labelProperty="AdminName"/>
</html:select>
 
S

steve

Hi,

I am having problems populating a dropdown list in a jsp page with
mulitple entries from a database. Can anyone please help me with the
code or point me in the right direction. Im am using the oreily custom
tags. The page is as follows.

<%@ page language="java" contentType="text/html" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ora.jsp.util.*" %>
<%@ taglib uri="/orataglib" prefix="ora" %>

<HTML>
<BODY>
<ora:sqlQuery id="sqlAdminDropdown" dataSource="AileenDB"
scope="session">
SELECT AdminName From Aministrator
</ora:sqlQuery>
<TABLE>
<TR>
<TD>
** Need to put the dropdown populated with ALL the
AdminName here **
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

I have tried things like the following but dont have a clue:

<html:select name="session">
<html:eek:ptionsCollection name="sqlAdminDropdown"
property="sqlAdminDropdown" labelProperty="AdminName"/>
</html:select>

you need to do some sort of call out to recover the list from the database.

I have a standard routine , in pl/sql code that returns a ref cursor back to
a java vector. , you just then stuff the vector items into the list.


steve
 
F

frawls

Hi Steve,

Thanks for the reply. Could you possibly give me an example, based on
my code above, of how to do this?

I am very new to java and would appreciate the help....

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top