Hibernate_.Util.java

package com.jtc.p1;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class Hibernate_Util  {
    static SessionFactory factory;
    static {
    try {
        Configuration cfg=new Configuration().configure("hibernate.cfg.xml");
        factory=cfg.buildSessionFactory();
       
    }catch(Exception e) {
        e.printStackTrace();
        }
    }
   
    public static SessionFactory getSessionFatory() {
        return factory;
    }
}

Comments

Popular posts from this blog

HTML& CSS USERNAME AND PASSWORD PAGE CODING

spring core exp

Swapping without using 3rd variable in c and c++ and any language use logic