Here, we are going to create the basic example in Hibernate. For creating the first hibernate application, we need to follow following steps:
Create Database Table
Create the Persistent(Pojo) class
Create the mapping file for Persistent class
Create the Configuration file(.cfg file).
Copy the jar files to classpath.
Create the Test class that retrieves/stores/update the persistence object.
Tools & technologies used in this article :
Create a new Database Schema and Table in MySQL :
Since I am demonstrating this application on MySQL database server, please ensure you have MySQL database installed on your machine. Refer My SQL Installation tutorial for installation of MySQL. Now after installation login to MySQL database using username and password from : Start -> Programs -> MySQL -> MySQL server 5.1 -> MySQL Command Line Client .Now follow the steps mentioned below
Step 1 : Create the database employeedb
From the command prompt type the query Create database employeedb;