Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

program running properly but values are not reflecting in database

 
ksrk mahidhar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i have run a hibernate example that has been given in rose india.com

programm is running perffectly with out any errors
in console its showing as

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Inserting Record
Done
Hibernate: insert into CONTACT (FIRSTNAME, LASTNAME, EMAIL, ID) values (?, ?, ?, ?)

but nothing inserting in database and iam using mysql database.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Greenhorn! Welcome to the JavaRanch.

Oh, and I updated your subject line to use full words rather than abbreviations. That should help get better responses here at the ranch.

And ksrk, could you please check your private messages for a tiny administrative matter? Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's really, really difficult to debug code when there's no code, though. Please see the FAQ entries ItDoesntWorkIsUseless and TellTheDetails. Thanks!
 
sarmaP lolla
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have any primary key on this table? Doesn't look like.

Also did you make sure that you are actually sending values for the first name etc.. ?

Also double check your hibernate configuration properties for auto commit.

Sarma
 
ksrk mahidhar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks i got solution for this
priviously i didn't added transaction in that
like
Transaction tx = session.beginTransaction();
and
tx.commit();--this shoud be after session.save
and problem is solved
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic