Hibernate

Create Session provider class
Previous Home Next

Step 4: Create Session provider class

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: