Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display sql records dynamically

Status
Not open for further replies.

styx218

Programmer
Apr 23, 2007
15
0
0
IE
Hi guys,

Just a quick question.I am developing a jsp application an dwould like to display records from my sql database dynamically from a drop down box.Is this possible.And would the page have to be reloaded everytime a user selected a record from the drop down box.Any help appreciated.

Regards,
styx218
 
You could do it one of two ways.

1. Have the page refresh each time the drop down is selected pulling down the record that the user selects.

2. Download all the records into a large (or HUGE) array and then simply update the page via javascript every time the drop down is changed.

If you have a small table (only a few records) then use option 2. If you have a larger table use option 1 to decrease database load, network traffic from the web server to the clients and web page load time.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Ok i settled on using sql:query tag to display my data,which is working fine.

How would i go about appending the choice selected in my drop down menu to a table on the same page? i am developing a fantasy football application which requires 11 drop down boxes and for the choices to be displayed as the user picks them
 
This is better asked in a Javascript forum. But I think I have some code around here that does what you're after. Let me look for an example and get back to you in a bit.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Not NULL-terminated yet.
 
Serendipity. I couldn't find my local code example, but I found a JS Web page that explains a possible solution.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Not NULL-terminated yet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top