This tutorial explains you, how to develop a simple database application using Hibernate Object Relational Mapping (ORM) framework and MySQL database. This article uses Annotation for mapping; the XML mapping is explained in: Hibernate - Hello, World! using XML Mapping
You need Eclipse for Java EE developers and MySQL server in your system in-order to try this tutorial.
Step 1:If you prefer to import the necessary libraries manually as shown in "Step 3 Without Maven", Eclipse for Java developers is enough. Those who prefer Maven projects, need to have M2Eclipse plugin in their Eclipse. This tutorial recommends Eclipse for Java EE, since it has M2Eclipse plugin by default. Also please be informed that the project attached at the end of this tutorial is created using Maven.
Create a database “javahelps” and a table “student” in MySQL.
CREATE DATABASE IF NOT EXISTS javahelps;
CREATE TABLE javahelps.student (
student_id INT NOT NULL ,
student_name VARCHAR(45) NOT NULL ,
student_age INT NOT NULL ,
PRIMARY KEY (student_id) );