Go Back   Java Programming Forums > Java Standard Edition Programming Help > JDBC & Databases

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 22-06-2009, 09:15 AM
Junior Member
 

Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
tyolu is on a distinguished road
Unhappy Combo box

Pls i need help on loading contents of a database into a combo box by default. The combo box is on a JSP page.



Reply With Quote Share this thread on Facebook
  #2 (permalink)  
Old 22-06-2009, 11:38 AM
JavaPF's Avatar
mmm.. coffee
 
5 Highscores

Join Date: May 2008
Location: United Kingdom
Posts: 1,210
Thanks: 59
Thanked 66 Times in 64 Posts
JavaPF is someone you want to know!JavaPF is someone you want to know!JavaPF is someone you want to know!

I'm feeling Inspired
Default Re: Combo box

Hello tyolu.

What database are you using? You will first need to setup the database connection...
__________________
Don't forget to add code tags around your code:

Forum Tip: Add to peoples reputation () by clicking the button on their useful posts.
Reply With Quote
Sponsored Links
  #3 (permalink)  
Old 22-06-2009, 12:02 PM
Junior Member
 

Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
tyolu is on a distinguished road
Default Re: Combo box

The database is mysql. I have already connected to the database. More so i'm using Hibernate for mapping my objects to the database.
Reply With Quote
  #4 (permalink)  
Old 22-06-2009, 01:14 PM
JavaPF's Avatar
mmm.. coffee
 
5 Highscores

Join Date: May 2008
Location: United Kingdom
Posts: 1,210
Thanks: 59
Thanked 66 Times in 64 Posts
JavaPF is someone you want to know!JavaPF is someone you want to know!JavaPF is someone you want to know!

I'm feeling Inspired
Default Re: Combo box

Hello tyolu,

Are you putting the returned SQL results in a Resultset? Please post your code for us to see.

You will need to do something similar to this with a for loop:

Java Code
<select>
<%
         for(----)
           {
                      String line =  Resultset object
                      out.print("<option>"+line+"   </option>");
                     
            }

%>
</select>
__________________
Don't forget to add code tags around your code:

Forum Tip: Add to peoples reputation () by clicking the button on their useful posts.
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




100 most searched terms
Search Cloud
2 dimensional arraylist java 2d arraylist java actionlistener actionlistener in java actionlistener java actionlistener jbutton addactionlistener addactionlistener java avatar hardware id convert double to integer java double format java double to int java double to integer in java double to integer java eclipse shortcut keys eclipse tutorial for beginners exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.outofmemoryerror: java heap space format double java get mouse position java hardware id avatar java 2 dimensional arraylist java 2d arraylist java actionlistener java addactionlistener java button actionlistener java convert double to int java convert list to map java double format java double to int java double to integer java for beginner eclippse java format double java forum java forums java get mouse position java ipod touch java jbutton java list to map java programming forum java programming forums java sendkeys java.lang.reflect.invocationtargetexception java.util.arraylist jbutton actionlistener jbutton java programming forums string to int java two dimensional arraylist java writing apps for ipod touch

All times are GMT. The time now is 02:08 PM.
Powered by vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.