DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JSP (http://www.daniweb.com/forums/forum24.html)
-   -   displaying data from oracle database in drop down menu using jsp (http://www.daniweb.com/forums/thread117054.html)

dream_ankur Apr 2nd, 2008 1:58 pm
displaying data from oracle database in drop down menu using jsp
 
Hi,
I am developing one website in which i have around 21 table in my database out of which 8 are master tables and rest are secondry tables. I want the data stored in some columns of master table to be displayed as drop down menu in my secondry table. few Column names are same in secondry table and master table. how do i do that???

jwenting Apr 3rd, 2008 12:34 pm
Re: displaying data from oracle database in drop down menu using jsp
 
by learning all about master-detail forms and queries, and learning why you should not use Java code from JSP.

groomy1on1 Apr 7th, 2008 3:09 am
Re: displaying data from oracle database in drop down menu using jsp
 
Quote:

Originally Posted by dream_ankur (Post 575279)
Hi,
I am developing one website in which i have around 21 table in my database out of which 8 are master tables and rest are secondry tables. I want the data stored in some columns of master table to be displayed as drop down menu in my secondry table. few Column names are same in secondry table and master table. how do i do that???

Have you tried joining two tables with a sql statement? I hope this can help
http://www.adp-gmbh.ch/ora/sql/outer_join.html

kaushik259106 Apr 10th, 2008 2:59 am
Re: displaying data from oracle database in drop down menu using jsp
 
I think he is asking how to display the column names in dropdown..
If thats the case use java code in your jsp(Though not the best practice).
Create a set with all the values and then parse it to display in the dropdown.. So as you told you dont want repeated data you can use something like this...

Quote:

Set abcd = new Hashset();
abcd.add("kaushik"); / / these values you can fetch from db
abcd.add("1234");
abcd.add("kaushik");
so if my value repeats also i wont get repeated value in the result set.. and at the end the set will have only two values.. kaushik and 1234..
Hope that help..
Also remember if you are doing in jsp itself then generic type wont work and throw exceptions afterwards while accessing..


All times are GMT -4. The time now is 1:37 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC