• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Direct Database Access!

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you build a jsp page which does that.
you connect to a database and accordingly build your html page.
 
Davie Rom
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I really dont get what you mean. Could you please specify it more specific ? Thank you !
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Davie Rom
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic