bharat patel

Greenhorn
+ Follow
since Sep 26, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bharat patel

Well, I am working on Spring with Hibernate. I am able to save values to my database using the HibernateTemplate's saveorupdate(). Now all I want is to display the values from the database tables onto my UI. I need the JSP code as well as the changes that I have to make to My DAO to show the values.

Below is the DAO that I an using.
public class BulletinDAO {
private HibernateTemplate hibernateTemplate;

public HibernateTemplate getHibernateTemplate() {
return hibernateTemplate;
}

public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
this.hibernateTemplate = hibernateTemplate;
}

public void setSessionFactory(SessionFactory sessionFactory) {
this.hibernateTemplate = new HibernateTemplate(sessionFactory);
}

public BulletinBO getBulletin(Long id) {
return (BulletinBO) getHibernateTemplate().get(BulletinBO.class, id);
}

public List getBulletins() {
BulletinBO bulletinBO =new BulletinBO();
List bulletins = getHibernateTemplate().find("from BulletinBO");
bulletins.add(1);
bulletins.add(2);
bulletins.add(3);
for (int i=0; i<bulletins.size(); i++){
System.out.println(bulletins.get(i).toString());
}
return bulletins;

}

public void saveBulletin(BulletinBO bulletinBO) {
getHibernateTemplate().saveOrUpdate(bulletinBO);
}

public void removeBulletin(Long id) {
Object record = getHibernateTemplate().load(BulletinBO.class, id);
getHibernateTemplate().delete(record);
}

}

Here the BO extension means it is a business object.

Any help would be highly appreciated.

Thanks in advance

Bharat