Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display values from database

 
Niet Ties
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to get info from a database using only the primary key. When someone presses a link in a page, he/she goes to the next page and the primary key is stored in a bean. Then I can display the primary key but I don't know how to display all the other info but the primary key. here is some of my code:


code for the next page:

in the wsdlBekijkenwsdl bean there is alse a set/get methode for the name and some more and I want to display them as well. Now is my question, can I get the other info from the database and display it?
 
Santosh Kumar V
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using Hibernate? do you have an entity class? please post the entire code of your bean.
 
Bart Kummel
author
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Niet,

How do you get your primary key? Do you get it from your database, or do you get if from another source. If you get it from your database, you already know how to access that database. In the other case, you probably need some persistence framework to access your database. JPA is a good choice, with several implementations available (Hibernate, EclipseLink, and others...)

How to use a persistence framework is out of scope of this JSF forum; you should go to the Object Relational Mapping forum for that.

Groeten :-)
Bart Kummel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic