Comment

FoldHero
Programmer,
May 7, 2009 at 11:41 PM

It is a great tutorial, and the ready to use project is really amazing.

For the beginners, if you are trying to work with FirstExample.java

the code should be modified a bit to insert a Contact.

SessionFactory sessionFactory = new Configuration().configure()
.buildSessionFactory();
session = sessionFactory.openSession();


System.out.println(session.getFlushMode().toString());
Transaction tr = session.beginTransaction();

Contact contact = new Contact();
contact.setId(6);
contact.setFirstName("Deepak");
contact.setLastName("Kumar");
contact.setEmail("deepak_38@yahoo.com");

session.save(contact);
tr.commit();
session.flush();
session.close();
System.out.println("Done");
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Jobs

Java Hibernate 3 Programmer
Java Hibernate 3 Programmer        Position Vacant: Java Hibernate 3 Programmer Job...; Reference ID: Java Hibernate 3 Programmer 

Jobs

Java Struts 2 Programmer
Java Struts 2 Programmer      ... Profile  Highly experience programmer, will to work on tight...; MCA  Having good experience in Hibernate and Struts 2  

Jobs

Java Spring Framework Programmer
Programmer Job Description  You will be working... programmer, will to work on tight schedule and challenging project. ... in Hibernate and Struts 2  Good communication and written skills  

Software Services

Hire Java Developer, Hire Java Programmer
Hire Java Developer/Programmer Hire Java Developers and experienced Java Programming team to develop world class enterprise applications. Hiring Java... JSF RichFaces Hibernate EJB3 ActiveMQ Dom4j jFreeChart Mysql PostgreSql 

Hibernate Questions

struts hibernate - Hibernate
struts hibernate   how to integrate struts and hibernate ?is need any plugin ?programmer manually create that plguin?   Hi.../struts-hibernate/ Thanks 

Hibernate Tutorial Example

Hibernate Tools Download
Hibernate Tools Download       In this we will show you how to download the Hibernate Tools for the development. Hibernate Tools is really a good tool that help 

Java Beginners

HOW TO BECOME A GOOD PROGRAMMER
HOW TO BECOME A GOOD PROGRAMMER  I want to know how to become good programmer   Hi Friend, Please go through the following link: CoreJava Tutorials Here you will get lot of examples with illustration where you can 

Java Beginners

Application Programmer with Fresher
Application Programmer with Fresher  what difference between http and httpsession? In http session connection is close after giving responce to the client?   when the client clear the cookies then server use url 

JSP Servlet Questions

fresher java programmer
 

Java Beginners

Oracle Certified Java Programmer Assistance
Oracle Certified Java Programmer Assistance  Hi all I wanted to know that I have recently completed my graduation and heading towards Post Graduation. I wanted to know that if I pass the OCJP certification will it be useful after 

Hibernate-Tutorials

Hibernate Tools
Hibernate Tools Hibernate Tools: Hibernate Tool is yet another cool set of tools from Hibernate.org to help the developers in hibernate programming... and database objects from existing database schema. Hibernate tools can be used 

Management

How to design project document for client and programmer
How to design project document for client and programmer  As a business analyst, how one can create a tailored artifacts for client and programmer 

Hibernate Interview Questions

HIBERNATE
HIBERNATE   What is difference between Jdbc and Hibernate 

Hibernate Questions

hibernate
hibernate  what is hibernate listeners 

Hibernate Interview Questions

hibernate
hibernate  what is hibernate flow 

Training

Be a Sun Certified Java Programmer
Be a Sun Certified Java Programmer in Roseindia Technologies     The course of Sun Certified Java Programmer is a hard nut to crack for most of the java learners and only extraordinary 

Jobs

Programmer Analyst VC++
Programmer Analyst VC++       Position Vacant: Programmer Analyst VC++  Job Description... Not Required Experience: 2- 6Years  Keywords: Programmer 

Jobs

Unix and Perl Programmer
Unix and Perl Programmer      ...; Experience: 1- 6 Years  Keywords: Perl Programmer, Perl, Jobs, Unix, Unix programmer, Linux, Linux programmers  Contact Information: Email 

Jobs

PERL & CGI Programmer
PERL & CGI Programmer       Position Vacant: PERL & CGI Programmer Job Description  Looking for CGI programmers having knowledge of Perl 

Hibernate Questions

hibernate
hibernate  what is hibernate why we use 

Java Beginners

hibernate
hibernate  how to uses optional column in hibernate 

Hibernate Questions

hibernate
hibernate  please give me the link where i can freely download hibernate software(with dependencies)   Learn hibernate, if you want to learn hibernate, please visit the following link: Hibernate Tutorials 

Hibernate Questions

Hibernate
Hibernate  hibernate delete query execution 

Hibernate Questions

Hibernate
Hibernate  how to use pagination concept in Hibernate 

Jobs

GIS Programmer
GIS Programmer      ... for dynamic individuals especially GIS software programmer/developer to be a part of our team.  Position Vacant: Web GIS Programmer/ Developer Job 

Hibernate Questions

hibernate
hibernate   I want to learn how to use hibernate framework in web application . for storing database in our application 

Hibernate Questions

hibernate
hibernate   I want to learn how to use hibernate framework in web application . for storing database in our application 

Web Services

Web Programmer
Web Programmer       Job Description : Client interaction, understanding requirements, coding &... programmer. Job location : Amsterdam, Holland. About the implemented technology 

Hibernate Questions

hibernate
why hibernate?  why hibernate?   Hibernate: -Hibernate... library. It solves object-relational impedance mismatch problems. Hibernate makes the application development process easy Hibernate saves the development 

Hibernate Questions

hibernate
hibernate  why we should use hibernate projection 

Java Beginners

hibernate
hibernate  pls give one simple example program for hibernate 

Hibernate Questions

Hibernate
Hibernate  Please tell me the difference between hibernate and jdbc 

Hibernate Questions

Hibernate
Hibernate  hello, how to run hibernate program in netbeans?please send me step by step instructions to run hibernate in netbeans 

Hibernate Questions

hibernate
hibernate  can any one one explain what is hibernate ?   Please visit the following link: Hibernate Tutorials 

Hibernate Questions

hibernate
hibernate  how to execute a sequence(in database) from Hibernate program or java program   Please visit the following link: Hibernate Tutorials 

Hibernate Interview Questions

Hibernate
Hibernate  How do you handle parent - child tables relationships in hibernate? How do you handle Detach state in hibernate 

Hibernate-Tutorials

Hibernate Tutorial for Beginners Roseindia
Learn Hibernate programming at Rose India.net website RoseIndia.Net website is providing many tutorials of the Hibernate framework. After learning these tutorials you will master the Hibernate ORM framework. These tutorials are good 

Hibernate Questions

hibernate
hibernate  how to impot mysql database client jar file into eclipse for hibernate configuration   Hi Friend, Please visit the following link: http://www.roseindia.net/hibernate/runninge-xample.shtml Thanks 

Hibernate Questions

Hibernate
Hibernate  hi sir i need hibernate complete tutorial for download   Hi Friend, Please visit the following link: Hibernate Tutorials Thanks 

Hibernate Questions

Hibernate - Hibernate
Hibernate Features  Hibernate features in eclipse 

Hibernate Tutorial Example

What is Hibernate in Java?
What is Hibernate in Java? - Hibernate is ORM tool in Java. Are you beginner... for the information about the Hibernate ORM? Then this is the best place to learn about Hibernate Framework in Java. The Hibernate in Java is framework used for developing 

Hibernate Questions

hibernate
hibernate  How to know how many columns changed in a table when we are using hibernate 

Hibernate Questions

hibernate
hibernate  hi what are the necessary jar files that we need to set in the classpath to execute a hibernate application 

Hibernate Interview Questions

HIBERNATE
HIBERNATE  How u connects database using hibernate 3.0? Where you have written the database configuration details 

Hibernate-Tutorials

HQL, Hibernate Query Language
HQL - Hibernate Query Language In this tutorial on HQL we will learn how...? The HQL stands for Hibernate Query Language, which is inspired by the SQL... and it properties. The Hibernate Query Language is very powerful tool 

Hibernate Questions

hibernate
hibernate   i am using hibernate3.2.5 and oracle9i. First i set classpath to ojdbc14.jar and all the hibernate jar files to path env variable.After that when i try to execute the program i got an error "unknown oracle major 

Hibernate Questions

hibernate
hibernate  Is there any other way to call procedure in hibernate other than named query????? if we are using session object to get the connection then why hibernate we can directly call by using a simple java class??????? please 

Hibernate Questions

hibernate
hibernate  when we using schemaExport in hibernate every time it drops the existing table and create new table ,if table contain dependent table then is it drop 

Hibernate Questions

Hibernate
of Hibernate. I followed all th steps as given in the tutorial, but a build error... hibernate library files are not included in the project build path. Please download the example from Hibernate Getting Started Tutorial. Please follow the steps 

Hibernate Questions

Hibernate
Hibernate  Hi i have 2 doubbts regarding Hibernate ,.. 1)Can we rename hibernate.cfg.xml? 2? can we use multiple mapping resource in hibernate.cf.xml file ? pls let me know soon 

Hibernate Questions

Hibernate
Hibernate  Can we write more than one hibernate.cfg.xml file... ? if so how can we call and use it.? can we connect to more than one DataBase from a single Hibernate program 

Hibernate Questions

hibernate - Hibernate
hibernate program shareware  hibernate program shareware example 

Hibernate Questions

Hibernate - Hibernate
Hibernate sessionfactory configuration  What is the process of hibernate sessionfactory configuration 

Hibernate Questions

hibernate
;Hi Friend, Please visit the following link: http://www.roseindia.net/hibernate 

Hibernate-Tutorials

Online Hibernate Training
The Online Hibernate training course is a comprehensive and detail oriented way... provides you the extensive instructions on using Hibernate 3.0 and 4.0. The online Hibernate training course highlights regarding the popular open source 

Hibernate Questions

hibernate...............
hibernate...............  goodevining. I am using hibernate on eclipse, while connection to database Orcale10g geting error .........driver ARNING: SQL Error: 0, SQLState: null 31 May, 2012 8:18:01 PM 

Hibernate Questions

Hibernate - Hibernate
Hibernate application development help  Hi, Can anyone help me in developing my first Java and Hibernate application 

Hibernate Questions

Hibernate - Hibernate
prog using hibernate query   Hibernate update query http://www.roseindia.net/hibernate/hibernate-update.shtml This will show you how to update records in hibernate! regards Meeya 

Hibernate Questions

hibernate - Hibernate
hibernate  is there any tutorial using hibernate and netbeans to do a web application add,update,delete,select   Hi friend, For hibernate tutorial visit to : http://www.roseindia.net/hibernate/index.shtml 

Hibernate Questions

hibernate - Hibernate
hibernate  pl send me hibernate interview questions 

Hibernate Questions

hibernate - Hibernate
hibernate    what is the lazy Loading in hibernate? can you give the example table ?  Lazy Loading in Hibernate In Hibernate, Lazy... in the program's operation. The syntax of lazy loading in Hibernate... public Entity 

Hibernate Questions

hibernate - Hibernate
: http://www.roseindia.net/hibernate/hibernate-aggregate-functions.shtml http://www.roseindia.net/hibernate/associations-and-joins.shtml Thanks 

Hibernate Questions

Hibernate
 

Hibernate Interview Questions

hibernate
 

Hibernate Questions

hibernate
 

Hibernate Interview Questions

Hibernate
 

Hibernate Questions

Hibernate
 

Hibernate Questions

Hibernate
 

Hibernate Questions

hibernate
 

Hibernate Questions

Hibernate
 

Hibernate Questions

hibernate
 

Hibernate Interview Questions

HIBERNATE
 

Hibernate Questions

Hibernate - Hibernate
Hibernate  how to call the stored procedure in mysql database server using hibernate..??  Hi Friend, Please visit the following link: http://www.roseindia.net/hibernate Thanks 

Hibernate Questions

Hibernate - Hibernate
Hibernate  Give me a brief description about Hibernate?How we will use it in programming?give me one example 

Hibernate Questions

hibernate - Hibernate
hibernate  hi friends i had one doubt how to do struts with hibernate in myeclipse ide its urgent 

Hibernate Questions

hibernate - Hibernate
hibernate  wts the use of inverse in hibernate? can any one explain the association mapping(1-1,1-many,many-1,many-many 

Hibernate Questions

Hibernate - Hibernate
Hibernate  What is a lazy loading in hibernate?i want one example of source code?plz reply 

Hibernate Questions

hibernate - Hibernate
hibernate  what is hibernate and how to make a pc hibernating?  Hi friend, Hibernate is based on object oriented concept like java... .properties file and in hibernate we use .xml file ,which is a better approach. We 

Hibernate Questions

hibernate - Hibernate
hibernate   hi,can any one tell me how to get SQL query in hibernate, when hql fire it will create sql in console when hibernate.cfg.xml property will true, but i want SQL query in one variable how to get it... Thanks satish 

Hibernate Questions

Hibernate - Hibernate
one example   Hi mamatha, Hibernate 3.0, the latest Open Source... not understandable for anybody learning Hibernate. Hibernate provides a solution to map.../hibernate/ Thanks. Amardeep 

Hibernate Questions

Hibernate Query - Hibernate
Hibernate Query  Hibernate Query 

Hibernate Questions

Hibernate - Hibernate
Hibernate  Hai,This is jagadhish.Iam learning Hibernate.I have a doubt in that area plz help me.That is In Hibernate mapping file I used tag...://www.roseindia.net/hibernate/ Thanks 

Hibernate Questions

Hibernate - Hibernate
Hibernate SessionFactory  Can anyone please give me an example of Hibernate SessionFactory?  Hi friend,package roseindia;import...;1.0"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate 

Hibernate Questions

Hibernate - Hibernate
Hibernate  Hello Deepak as you answer posted this is solution of if any file not found but my question is .. Error is ::: Error in reading contact.hbm.xml contact.hbm.xml is my hibernate mapping file. So please read 

Hibernate Questions

Hibernate - Hibernate
. http://www.roseindia.net/hibernate/ Thanks 

Hibernate Questions

Hibernate - Hibernate
Hibernate   Dear sir Thanks for your previous answers its really... ,hibernate, jboss, oracle) one is 1) Express and 2) MDM(All master data... 192.168.1.2 using hibernate(Schema name Express) In MDM i am connecting 

Hibernate Questions

Hibernate - Hibernate
Hibernate  when I run Hibernate Code Generation wizard in eclipse I'm getting the following error. I added ojdbc14.jar to my build path. Still I'm.../hibernate/index.shtml Hope that it will be helpful for you. Thanks 

Hibernate Questions

hibernate - Hibernate
. For read more information: http://www.roseindia.net/hibernate/index.shtml 

Hibernate Questions

Hibernate - Hibernate
Hibernate  I am trying to connect hibernate with ejb2.0 stateless session bean, my application sucessfully deploy in weblogic server but when i execute the client application i got an error message that class not found exception 

Hibernate Questions

Hibernate - Hibernate
Hibernate pojo example  I need a simple Hibernate Pojo example ...){ System.out.println(e.getMessage()); } finally{ } }}hibernate mapping <class name... information,http://www.roseindia.net/hibernate/hope it will help u 

Hibernate Questions

hibernate - Hibernate
Hibernate; import org.hibernate.Session; import org.hibernate.*; import...   Hi Radhika, i think, you hibernate configuration.... http://www.roseindia.net/hibernate 

Hibernate Questions

hibernate - Hibernate
hibernate  I have written the following program package Hibernate; import org.hibernate.Session; import org.hibernate.*; import org.hibernate.cfg.*; import java.util.*; public class NewHibernateSample { public 

Hibernate Questions

hibernate - Hibernate
hibernate  hi i am new to hibernate. i wan to run a select query with oracle database. could you please help me out. my files are: package... hibernate for use SessionFactory sessionFactory = new Configuration 

Hibernate Questions

Hibernate - Hibernate
Hibernate  Hai this is jagadhish while running a Hibernate application i got the exception like this what is the solution for this plz inform me.../hibernate/ Please specify your requirements in detail. It would be good 

Hibernate Questions

Hibernate - Hibernate
Hibernate  Hai this is jagadhish, while executing a program in Hibernate in Tomcat i got an error like this HTTP Status 500 - -------------------------------------------------------------------------------- type 

PHP Tutorial

What a PHP Programmer Can Do
are able to work with more than just the PHP language. A good programmer..., a good programmer will also know that the language is not the only thing needed... and Java. A programmer will need to know how all of these languages work so 

Hibernate Questions

hibernate on netbeans - Hibernate
hibernate on netbeans  is it possible for me to run the hibernate program on Netbeans IDE 

Hibernate Interview Questions

Hibernate - Hibernate Interview Questions
Hibernate  What is a fetching in hibernate 

Hibernate Questions

Hibernate - Hibernate
 

Java Beginners

[Mini-Project] Develop a programmer's editor in Java that supports syntax highlighting, compilation support, debugging support, etc.
[Mini-Project] Develop a programmer's editor in Java that supports syntax highlighting, compilation support, debugging support, etc.  Please reply me sir 

Advertisements Advertisements
 

 

 

DMCA.com