• Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieve data from database  RSS feed

Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very simple JSF application with hibernate. I get values from the user through the above said application and used hibernate mapping files to save data into database and it works fine till that.

In the initial set up, I have a drop down list which I had configured through faces-config.xml file as key and value of a hashmap. I could get the drop down menu and allow the user to select this value and get it as bean and finally saving into database.

Now I would like to add some more features. I would like to get the list (one of the column) from a table(list_table) in the database and display for the users in the web page. How do I achieve this?

1. Do I have to add one more hbm file according to list_table?
2. Then use a separate java class (list.java) with beans ( for the column name as list_table with getter and setter method) and call $list.column name) in my jsf page to display the list for the users.

I haven't tried this and I want to know how to proceed further.

Basically I want to read one column from a table and display as a list in my jsf page. Please give some suggestions.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!