CRUD operations using Hibernate+ Maven+ Oracle+ XML mapping

In this tutorial, we will explain how to make CRUD operations using Hibernate 4.3.6. Tools & technologies used in this article: Java 1.6 Maven 3.2. Hibernate 4.x Oracle 11.2.0 Eclipse 1)  POM.xml Add Hibernate 4.3.6 and Oracle 11.2.0 dependencies to the project.

2)  Create a resources folder under “src/main” folder,  and add Hibernate configuration […]

Hibernate development environment setup with Maven and Eclipse

In this tutorial, we will explain, how to set up hibernate using Maven and Eclipse. Tools & technologies used in this article: 1. Java 1.6 2. Maven 3.2.3 3. Hibernate 4.x 4. Oracle 11.2.0 5. Eclipse 1) Create Maven project in Eclipse In project explorer, Right click -> choose New ->Other and Select Maven as below.   […]

How to get 120 with five zeros by doing any arithmetic operation?

Answer is simple. We have to use factorial to get 120.

Let me explain how o!=1. We know that, n! can be defined as below.

substitute n=1.

So 0!=1

What is Hibernate mapping file?

Hibernate mapping file is used to map java object to the database table. We can have any number of mapping files in a project. Each hibernate mapping file must contain only one <id> tag (or relevant tag <composite-id>) <id> tag corresponds to either primary key or Non primary key. Hibernate need unique key to map […]

What is dialect class in Hibernate?

To connect to any database with hibernate, we need to specify the SQL dialect class in hibernate.cfg.xml      Ex: To connect to oracle database we need to specify oracle dialect class in configuration xml as below.

Dialect class is java class, which contains code to map between java language data type database data […]

What is Hibernate configuration file?

Hibernate uses this file to establish connection to the database server. It is an XML file which is used to define DataBase connection details: Driver class, URL, username and Password. Hibernate properties: Dialect, show_sql, second_level_cache ..etc Mapping files names. One configuration file for each database. Standard name for this file is hibernate.cfg.xml Syntax of Configuration xml: […]

Introduction to Hibernate Framework

Hibernate was started in 2001 by Gavin King (who created Jboss server) with his colleagues from Cirrus Technologies as an alternative to using EJB2-style entity beans. Its original goal was to provide better persistence capabilities than provided by EJB2 by simplifying the complexities and supplementing missing features. Objective of Hibernate:  It provides features to develop data access […]

How to Convert Date to String in Java

In this tutorial we will learn how to convert date to String in Java. Let us have a look in to the below code snippet. By using the format() method from SimpleDateFormat class we can convert date to String. P.S Refer to – SimpleDateFormat Java Docs



How to convert char Array To String in Java

In this tutorial we will see how to convert char Array To String in Java. Let us have a look in to the below example code. By passing the Char array to String constructor we can achieve this.


  Happy learning String tutorials…. 🙂   

what is the difference between equals() and == in java

  In this tutorial we will lean what is the difference between equals() meathod and “==” operator  in java. Let us have a look in to the below example.                                            

    Scenario 1 […]