Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rating: Thread Rating: 2 votes, 3.50 average. Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 1st, 2002, 03:55 AM
obbsi obbsi is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Australia
Posts: 0 obbsi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
displaying data in a select box using JSP

I'm hoping someone can help with displaying data from a db into a select box using JSP. Can work out the SQL, just not how to actually display the data.

have been unable to find any examples/info on select boxes so far, any suggestions would be much appreciated!

Reply With Quote
  #2  
Old May 1st, 2002, 11:50 PM
aabha aabha is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: India
Posts: 7 aabha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to aabha
<%@ page import = “java.sql.*” %>
<HTML>
<BODY>
<%
Connection con = DriverManager.getConnection("url",uid","pwd");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("Select colname from ur table");
out.println("<SELECT>");
while (rs.next()){
out.println("<OPTION>" + rs.getString(colname) + "</OPTION>");
}
out.pritln("</SELECT>);

%>
</BODY>
</HTML>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > displaying data in a select box using JSP

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap