Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes  page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark " page" Watch " page" New topic
Author

page

sudhakar ananth
Ranch Hand

Joined: Feb 02, 2007
Posts: 68
Hey friends
how can i get values from database to Java servlet page while it is loading itself

i mean
when the .jsp page will be loaded(displayed on the brower)it should be having the values from database

Ex: <html:select....>

this drop dowm list should have the values from the database wen the page is displayed.

Thanks for you help friends
Rao Raghu
Ranch Hand

Joined: Jan 05, 2007
Posts: 100
You should make use of the JDBC here. Write the DB code in your jsp and you have the values you want in your jsp.


RAGHU<br /> <br />"When the going gets tough, the tough get going"
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

Originally posted by rao raghu:
Write the DB code in your jsp ...


The experienced programmers would advise against coding database access in a JSP. It's a poor programming structure to employ.

Please read this article.
[ February 05, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

sudhakar ananth, surely you could have come up with a better topic title than "page". Please read this.
 
Consider Paul's rocket mass heater.
 
subject: page
 
Similar Threads
how to display list using jsf
Where to keep values?
User Interface
Swing Components - User Interface
regarding getting updated values in JSP on the fly