• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Data is not inserting

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello There,
I am working with Hibernate and I am unable to insert any data into DB

-------------------------------------------------------------------------------

[hibernate.cfg.xml]

-----------------------------------------------------------------------------
[book.hbm.xml]

-----------------------------------------------------------------------------
[ mypkg/Book.java ]

-----------------------------------------------------------------------------
[ BookTest.java ]

-----------------------------------------------------------------------------
[ HibernateSession.java ]

------------------------------------------------------------------------------------
Here it is what I have in my whole program under "mypkg" package. I am using Hibernate2.1, MySQL4.1 and also I have all required class/jar files in my classpath, since I am working with Eclipse3.1.

I am getting only this message:

Hibernate: insert into books
(title, author, isbn, pagecount, copyright, cost) values (?, ?, ?, ?, ?, ?)

No Data at all !

Please help me in this context. Thanks in Advance.

[Edited to use code tags - Paul Sturrock]
[ October 03, 2006: Message edited by: Paul Sturrock ]
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to call session.getTransaction().commit() before calling session.close() or set hibernate.connection.autocommit to true.
 
Gyaneshwar Prasad
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Scott,
Sorry for replying too late. Its really working . thumb:
Thank again!
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic