File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

display values from database

Niet Ties
Greenhorn

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
Greenhorn

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
author
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
 
Similar Threads
h:datatable, how multiply row cell A with row cell B and set value in row cell C
lucene highlighting + jsf
Creating List/Array of Managed Beans
dataTable troubles
setting up hashmap key in t:SelectBooleanCheckbox in a dataTable