5 Replies - 736 Views - Last Post: 05 October 2011 - 04:15 PM

#1 nashbender  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 21-April 11

hyperlink the data from the database

Posted 25 September 2011 - 06:39 PM

hi all!

i have a problem. i'm making a dynamic web project where we can key in info about employees and displaying info about the employee. I'm using jsp and servlets and the database using postgresql.

now i'm stuck at the part where i need to retrieve the names of the employees and set it as a clickable hyperlink. when we click on the names (retrieved from database)...will lead to a page about his/her profile - info about name, department, position..etc

can anybody tell me how to go about that? i'll give my code if you'd like, but i had just done the retrieving info and put it in a table. which is not practical if theres a lot of data.

thanks in advance and i hope i made it clear

Is This A Good Question/Topic? 0
  • +

Replies To: hyperlink the data from the database

#2 sbromley  Icon User is offline

  • D.I.C Head

Reputation: 21
  • View blog
  • Posts: 127
  • Joined: 20-May 09

Re: hyperlink the data from the database

Posted 29 September 2011 - 03:42 PM

Are you just using jsps or are you using a framework of any type?
Was This Post Helpful? 0
  • +
  • -

#3 nashbender  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 21-April 11

Re: hyperlink the data from the database

Posted 30 September 2011 - 01:00 AM

i'm just using the jsps. no framework.
Was This Post Helpful? 0
  • +
  • -

#4 sbromley  Icon User is offline

  • D.I.C Head

Reputation: 21
  • View blog
  • Posts: 127
  • Joined: 20-May 09

Re: hyperlink the data from the database

Posted 03 October 2011 - 01:52 PM

Alright so I think I need a little more information, so what you are trying to do is see a list of employees and you want these to be links to some other page, or you want a search bar and when you start to type in a name it autocompletes an employee name for you?
Was This Post Helpful? 0
  • +
  • -

#5 nashbender  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 21-April 11

Re: hyperlink the data from the database

Posted 04 October 2011 - 06:15 PM

sbromley:

yes..the first option is what i wanted to do. The list of employee names is from the database. and i want them to be links that will direct to another page displaying their whole profile. hope i clarify some things and hope you can help me..thanks :)
Was This Post Helpful? 0
  • +
  • -

#6 sbromley  Icon User is offline

  • D.I.C Head

Reputation: 21
  • View blog
  • Posts: 127
  • Joined: 20-May 09

Re: hyperlink the data from the database

Posted 05 October 2011 - 04:15 PM

Alrighty cool, so I'm not sure what your architecture looks like right now, but this is a pretty common task in web applications. One, pretty simple, way to solve it is by using an MVC pattern. Model, View, Controller.

http://net.tutsplus..../mvc-for-noobs/

These guys explain it pretty well. Towards the middle of the article they push for a framework, but its isn't necessary to implement this.

So a quick and dirty example would be
HomePage.jsp
User: clicks on a link that goes to the page where you want this table of employess
A controller class would see this go to the backend, where you could have a Data Access Object surrounding your database for ease of access to data, and ask for the urls to the employees pages.
The controller sends the urls to the view that sticks them in an anchor tag.

There is some finesse that you would have to figure out with what technology you want to use for which pieces, but overall it gets the job done and keeps your design decoupled which is always awesome.

Let me know if you need more help.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1