aspose file tools*
The moose likes JSP and the fly likes Direct Database Access! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Direct Database Access!" Watch "Direct Database Access!" New topic
Author

Direct Database Access!

Davie Rom
Greenhorn

Joined: Sep 06, 2005
Posts: 8
I am sorry if I post this thread in the wrong forum, but i really dont know where to put it !
How can we build a direct link to the content of the database. For example,when i click a link on a HTML page, let's say a employee name, it goes to a page which displays the particular information stored in database of that employee without hard-code a HTML page for that employee.
Thank you for your help in advance!
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
you build a jsp page which does that.
you connect to a database and accordingly build your html page.


Life called,so here I am.<br />Cheers<br />Niki.:-)
Davie Rom
Greenhorn

Joined: Sep 06, 2005
Posts: 8
I really dont get what you mean. Could you please specify it more specific ? Thank you !
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Well you can't do what you ask with HTML directly, since HTML is client side and static. However you can build your HTML using a JSP, as Niki Nono suggests. What you would need is some JSP/Servlet code which queries the database (using JDBC) and displays a list of employees available. Each employee could be a link to go to another JSP which displays the employee detail. Do you follow?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Davie Rom
Greenhorn

Joined: Sep 06, 2005
Posts: 8
Thank you very much Paul Sturrock. Getting the list of the available employee is not the problem, but to make "Each employee could be a link to go to another JSP which displays the employee detail" (According to your previous post) is my problem. I am not really sure how to do it! Thank you for your help in advance.
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
when you read the database rows in your jsp, you do it in a loop.
and the link you set it in the loop itself.
so i believe you can do that in the loop.



i hope this is what you were asking.
[ September 09, 2005: Message edited by: Niki Nono ]
Davie Rom
Greenhorn

Joined: Sep 06, 2005
Posts: 8
Thank you for your help, but I have the problem in how to send the parameter from 1 servlet to another servlet just becuase in the second servlet i will do another database connection to get further informtion.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Davie,
It sounds like you're getting ahead of yourself a bit.
If you are going to work with Servlets and JSP, why not pick up a good book or follow some JSP tutorials so that you have a better understanding of the various building blocks provided by the technology. Once you have that understanding, you'll see all kinds of ways to do these things and only have to worry about which is best for your needs.

If you search on this and the servlets forum with keywords "book" and "books" you'll find plenty of good recommendations.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Direct Database Access!
 
Similar Threads
extract data from record
Help regarding a link to a page from servlet
can server send picture in 'ajax' interaction
Oracle 10g portal.
ask for login