hello i have doubt in executing the hibernate program on MYECLIPSE IDE please clarify this one
i have used Oracle xe for database.
i have created the table in the database as follows.
sql>create table emp(empno number(3),empname varchar2(10), empsalary number(5));
and then am done what ever stuff is there to execute the program
and then i create class in the package org.stud;
my class name is MyCls and myprogram is as follows
package org.stud;
import org.hibernate.*;
public class MyCls {
public static void main(
String[] args)throws Exception {
Session hsession=org.stud.OraSF.getSession();
Transaction tx=hsession.beginTransaction();
org.stud.Emp emp=new org.stud.Emp();
emp.setEmpno(new Long(1));
emp.setEmpname("raj");
emp.setEmpsalary(new Double(133));
hsession.save(emp);
tx.commit();
org.stud.OraSF.closeSession();
}
}
i got the errors in the program emp.setEmpno(),emp.setEmpname()and emp.setSalary()
tell me how the errors came and then am executing the program eclipse show the errors as
Exception in
thread "main" java.lang.Error: Unresolved compilation problems:
The method setempno(Long) is undefined for the type Emp
The method setempname(String) is undefined for the type Emp
The method setempsal(Double) is undefined for the type Emp
at org.stud.MyCls.main(MyCls.java:9)
please solve this one and give me answer for me.