Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Hibernate Hibernate Basic Example not working
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


venkat reddy
Hibernate Basic Example not working
0 Answer(s)      a year and 7 months ago
Posted in : Hibernate


I have implemented basic hibernate example from your site . In console i got output but database is not affected. hbm.xml

<id name="id" type="long"  column="id">
    <generator class="Assigned" />
 </id>

<property name="name" >
    <column name="name" />
</property>

<property name="sex" >
    <column name="sex" />
</property>
 </class>

Main package com.tcs; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class Imp { public static void main(String[] args) { Session session = null; try{ SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); session =sessionFactory.openSession(); System.out.println("Inserting Record"); Bookdetails book = new Bookdetails();

      book.setname("venkat");
      book.setid(12102);
      book.setsex("male");
      session.save(book);
      System.out.println("Done");
      }catch(Exception e){
      System.out.println(e.getMessage());
      }
      finally{
          session.flush();
          session.close();
          }
      }
 }

Advertisement
View Answers

Related Tutorials/Questions & Answers:
Hibernate Basic Example not working
Hibernate Basic Example not working  I have implemented basic hibernate example from your site . In console i got output but database is not affected. hbm.xml <id name="id" type="long" column="id"> <generator
Update not working in hibernate.
Update not working in hibernate.  Update not working in hibernate
Advertisements
StandardServiceRegistryBuilder not working in Hibernate 4.3.1
StandardServiceRegistryBuilder not working in Hibernate 4.3.1  Hi, It seems that the StandardServiceRegistryBuilder not working in Hibernate 4.3.1.... working with the Hibernate 4.3.1 and it is giving following error message: Access
Dynamic-update not working in Hibernate.
Dynamic-update not working in Hibernate.  Why is dynamic update not working in hibernate?   Dynamic-update is not working. It means when you are running your update, new data is added in your table in place
Need an example of basic code.
Need an example of basic code.   Im working on an art project that I want to use some code in, and I am proficient in python but that looks fairly... of the building blocks of my idea so if someone could provide an example I would
Need an example of basic code.
Need an example of basic code.   Im working on an art project that I want to use some code in, and I am proficient in python but that looks fairly... of the building blocks of my idea so if someone could provide an example I would
Need an example of basic code.
Need an example of basic code.   Im working on an art project that I want to use some code in, and I am proficient in python but that looks fairly... of the building blocks of my idea so if someone could provide an example I would
spring basic example
spring basic example  hi,, i cannot understand the flow of the spring mvc example. can you explain execution flow of the spring example project?? thanks
Your hibernet tutorial is not working - Hibernate
Your hibernet tutorial is not working  Hi, I am learning hibernate from your tutorial. when i execute the 1st hibernate example at following location http://www.roseindia.net/hibernate/firstexample.shtml it working
JDBCTemplate BatchUpdate() example not working
JDBCTemplate BatchUpdate() example not working  Hi, I tried the JDBCTemplate BatchUpdate example, with IBM DB2 database. I updated the dataSource bean values accordingly. When I try, the program runs fine, however the database
Working Example for Spring AOP - Spring
Working Example for Spring AOP  Hi All, I need a complete working Java example /Code/Logic for Spring -Aspect Oriented Programming. Code provided will be highly appreciated. -- Deepak Lal
myJSF,Hibernate and Spring integration code is not working. - Hibernate
myJSF,Hibernate and Spring integration code is not working.  the code given in this url : http://www.roseindia.net/roseindiamembers/login.php i have tried but it does not work. when i write http://localhost
Hibernate Example
This tutorial illustrate an example of hibernate
Simple Example of Hibernate 4
Simple Example of Hibernate 4  Hi, As a new comer in the Hibernate programming, I want simple program of Hibernate to learn the basic concepts. Share me the best example. Thanks   Hi, Check tutorial: Hibernate 4
Hibernate Criteria And Or Example
Hibernate Criteria And Or Example  Hibernate Criteria And Or Example I want example of Hibernate Criteria And Or in Java Thanks   Example of Hibernate Criteria And Or Criteria Check the tutorial Hibernate Criteria
Dirty Checking In Hibernate Example
Dirty Checking In Hibernate Example  What is the example of Dirty Checking in Hibernate? Give me some of the example code? Thanks
Hibernate criteria date Example
Hibernate criteria date Example  Example of Hibernate criteria date. Check the tutorial hibernate criteria date. Check the Latest tutorials, articles and examples of Hibernate Framework. Thanks
Hibernate Criteria Count Example
Hibernate Criteria Count Example  Example of Hibernate Criteria Count. Check the tutorial Hibernate Criteria Count. Check the Latest tutorials, articles and examples of Hibernate Framework. Thanks
hibernate annotations example for mappings
hibernate annotations example for mappings  Please send me example of hibernate annotations for mappings.Please send the example   Please go through the following link: Hibernate Annotations
Dialect in Hibernate Example
Dialect in Hibernate Example   I want example of Dialect in Hibernate...   List of Dialect in Hibernate ORM framework. Check the tutorial Dialect in Hibernate. Check the Latest tutorials, articles and examples of Hibernate
Hibernate criteria average Example
Hibernate criteria average Example   How to find the average in Hibernate? Thanks   Example of finding average on a filed in Hibernate... the tutorial Hibernate criteria avg.. Check the Latest tutorials, articles
Hibernate Criteria With Collections Example
Hibernate Criteria With Collections Example  Good code of Hibernate Criteria With Collections Example. Thanks   Example program of using Hibernate Criteria With Collections in your Java project. Check the tutorial
Hibernate Criteria Between Example
Hibernate Criteria Between Example  How to use the Between in the Hibernate Query? Share me good example code. Thanks   Example of Hibernate Criteria Between. Check the tutorial Hibernate Criteria Between. Check
Hibernate Criteria And Restrictions Example
Hibernate Criteria And Restrictions Example  How to use Criteria And Restrictions in Hibernate? Thanks   I will provide you the example code of Hibernate Criteria And Restrictions. Check the tutorial Hibernate
Hibernate Spring Example
In this section, you will learn how to Integration Hibernate with Spring with an example
Hibernate criteria for date. Example
Hibernate criteria for date. Example  What to use the Hibernate criteria for date in Hibernate based application? I want example of Hibernate criteria for date in Hibernate orm. Thanks   Example of Hibernate criteria
Dirty Checking In Hibernate Example
Dirty Checking In Hibernate Example  Hi, What is Dirty Checking In Hibernate? Explain me with the help of Example. Thanks   The Dirty Checking In Hibernate is an mechanism for automatically detects the changes
Explain Hibernate Relationships with example.
Explain Hibernate Relationships with example.  Hello, Please explain various hibernate relationships. And if you can provide some examples that would be a great help.. Thank you....   Hi, Hibernate relational
hibernate criteria disjunction Example
hibernate criteria disjunction Example  I want example of hibernate criteria disjunction. Thanks   Example of hibernate criteria disjunction. Please check the tutorial hibernate criteria disjunction. This tutorial
Hibernate Detached Criteria Example
is useful when Hibernate session is not available. Check the example of Hibernate...Hibernate Detached Criteria Example  How to use Hibernate Detached Criteria in Java program? What is the use of Hibernate Detached Criteria? Explain
Hibernate Criteria Wildcard Example
want example of Hibernate Criteria Wildcard which is easy to understand. Thanks   Example tutorial in Hibernate for getting the data through...Hibernate Criteria Wildcard Example  Hi, How to write Java program
Advertisements
 

 

 

DMCA.com