Before we proceed further on how to start with hibernate and how to execute your first hibernate program.Please make sure that you have following software ready.
1. Java 1.6 or +
2. MySQL 5 or +/Oracle 10G
Make sure you have Employee table with eid, first_name, last_name. email column.
Compile both java file and run.
If you run into any problem , feel free to ask .(If possible attach screen shot of the problem)
1. Java 1.6 or +
2. MySQL 5 or +/Oracle 10G
Make sure you have Employee table with eid, first_name, last_name. email column.
Step by step procedure of how to run first hibernate program
- Download latest version of hibernate software (jar files) from http://sourceforge.net/projects/hibernate/
- Unzip the zip file which you downloaded in step 1.
- Add all jar files of hibernate-search-4.5.1.Final\dist\lib\required folder to class path,separated by semi colon.
- Add jar files of hibernate-search-4.5.1.Final\dist folder to class path, separated by semi colon.
- If you are using Oracle as your database then also add oracle related jar file to class path.
- Create a directory for all hibernate related programs you will practice from here onward.
- EmpBean.java is a simple Java file which have getter and setter methods.(All members of this class should be non-static only)
- Hibernate.cfg.xml is a hibernate configuration file, which contains property related information.Like DB software related url, driver information etc.
- Hibernate.map.xml is a hibernate mapping file, which is used to map java pojo class(EmpBean.java) members with Database table column.
- FirstProgram.java is a java file which contains hibernate based persistence logic.
Compile both java file and run.
If you run into any problem , feel free to ask .(If possible attach screen shot of the problem)
No comments:
Post a Comment