wood burning stoves 2.0*
The moose likes JSF and the fly likes A Very little problem in h:dataTable implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "A Very little problem in h:dataTable implementation" Watch "A Very little problem in h:dataTable implementation" New topic
Author

A Very little problem in h:dataTable implementation

Adnan Gondal
Ranch Hand

Joined: Apr 30, 2011
Posts: 32
Hi all! I'm having a bean class employee having attributes id,name along with public getters and setters.

I'm using following bean for db connection and getting values from database table.

TableBean.java:



Following is jsf page:



Kindly reply.
Thanks in advance.
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Actually I would say that your problem is in your data layer.

Question: What do you expect the ResultSet returned from this method to do?

Fun fact #1: You cannot access data in a result set that is closed
Fun fact #2: You close the results set in the finally statement of your method which returns the result set.

I suspect that might be the technical source of your problem.

In general, returning a ResultSet from a method is normally a bad idea.
The standard practice is to iterate of all the results in the result set, store them into a List of Beans, close the result set, and return the List of beans.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A Very little problem in h:dataTable implementation
 
Similar Threads
Setting up a JSF project with data tables
How to use INSERT INTO ALL statement in jdbc prepared statement with beans
How to edit database table in jsf
JSF ArralyList rendering to Target page is throwing Class Cast Exception
problem JSF - datatable from DB