package roseindia;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

public class CreateData {


	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		
		SessionFactory sessFact = HibernateUtil.getSessionFactory();
		Session sess = sessFact.getCurrentSession();
		org.hibernate.Transaction tr = sess.beginTransaction();
		
		Student stu = new Student();
		stu.setSname("Deepak 2");
		stu.setSroll(100);
		stu.setScourse("B.C.A.");
		
		sess.save(stu);//Save data
		tr.commit();
		System.out.println("Successfully inserted");
		//sess.close();
	}

}
