This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with showing records in hibernate  RSS feed

 
shankhas sanyal
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I am learning hibernate from scratch. so please guide me if i may be wrong.

i have a simple console based hibernate application that is being run on netbeans ide.

my hibernate.cfg.xml :




my emp.hbm.xml


my emp.java





my main.java (contains main method)



i have 5 records in the emp table. when i run this program. it show 5 times null.

output:






can anyone suggest how can i show the records and please guide me.

thanks
Shankha
 
shankhas sanyal
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i fixed this problem on my own with this piece of code



 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!