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();
}
}
}
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
Post a Comment