This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSF and the fly likes How do I connect to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSF
Bookmark "How do I connect to database" Watch "How do I connect to database" New topic

How do I connect to database

Mansingh Shitole

Joined: Jun 10, 2008
Posts: 4
In our JBoss JBpm project we are using JSF for UI's and those all are xhtml files...So how do I retrive from database and display in xhtml files.
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Hi Mansingh,

When you retrieve data from a db, you get a java.sql.ResultSet. You can convert each record of that result set to a custom type, say Person, and add each person to a Collection. then use jsf dataTable to render that collection.

Bob's your uncle.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: How do I connect to database
It's not a secret anymore!