• 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

display values from database

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using Hibernate? do you have an entity class? please post the entire code of your bean.
 
author
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic