User_B.java

package com.jtc.p1;


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

import org.hibernate.Transaction;


public class User_B {
    public static void main(String[] args) {
        try {
            SessionFactory sf=Hibernate_Util.getSessionFatory();
            Session  session=sf.openSession();
            Transaction tx=session.beginTransaction();
            Object o= new Customer_PoJo();
            Customer_PoJo cust1=(Customer_PoJo)session.load(Customer_PoJo.class, 1);
            System.out.println(cust1.getCid()+"\t"+cust1.getCname()+"\t"+cust1.getEmail()+"\t"+cust1.getCity()+"\t"+cust1.getPhone()+"\t"+cust1.getBal());
            tx.commit();
            session.close();
           
        }catch(Exception e) {
            e.printStackTrace();
        }
           
    }
}

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