HP Integrity NonStop J-Series User Manual
Page 208
Advertising

Employee emp = null;
do {
if (emps.hasNext()) {
emp = (Employee) emps.next();
System.out.println("----------" + emp.getId());
System.out.println("----------" + emp.getFname());
}
} while (emps.hasNext());
return (emp);
}
public void createEmpl() {
try {
tx = session.beginTransaction();
Employee emp = new Employee();
emp.setAge(23);
emp.setFname("Test");
emp.setLname("Data");
session.save(emp);
tx.commit();
} catch (HibernateException e) {
if (tx != null)
try {
tx.rollback();
} catch (HibernateException e1) {
System.out.println("rollback not successful");
}
}
}
After adding the necessary packages and the classes under them, the EmployeeInfo project appears
as:
208 Getting Started with Hibernate
Advertising
This manual is related to the following products: