Hibernate

SessionProvider is created for creating the object of session
Previous Home Next

Step 4:

SessionProvider is created for creating the object of session.

sessionProvider.java

package r4r;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class SessionProvider {
static SessionFactory factory;
static
{
Configuration cfg=new Configuration().configure();
factory=cfg.buildSessionFactory();
}
public static Session getSession() {
return factory.openSession();
}
}
Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: