wood burning stoves 2.0
The moose likes JSF and the fly likes display values from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "display values from database" Watch "display values from database" New topic

display values from database

Niet Ties

Joined: Mar 22, 2010
Posts: 1
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

Joined: Mar 17, 2010
Posts: 5
Are you using Hibernate? do you have an entity class? please post the entire code of your bean.
Bart Kummel
Ranch Hand

Joined: Nov 30, 2007
Posts: 81
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

SCJP 1.4 | SCJD 1.6 | Visit my website | Author of the book Apache MyFaces 1.2 Web Application Development
I agree. Here's the link: http://aspose.com/file-tools
subject: display values from database
It's not a secret anymore!