This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSF and the fly likes retrieve data from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "retrieve data from database" Watch "retrieve data from database" New topic
Author

retrieve data from database

Gopu Akraju
Ranch Hand

Joined: Jan 13, 2008
Posts: 242
Hi,
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.
Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: retrieve data from database
 
Similar Threads
accessing database using javascript
How to display retrivied users from the Datase into Drop-down menu using servlet+JSP(JSTL)
Displaying values in the datatable!
show and insert data from list depending on choice of radio button
Can I add JSF components through Ajax?