• 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Spring Hibernate - Not Saving to Database Table via HibernateTemplate

 
Ranch Hand
Posts: 186
1
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am having a problem in which my Spring Hibernate Application is not storing created objects into a Database Table via the Hibernate template. Here is my code

Hibernate Mapping File:


Application Context:


POJO/Bean Class:


DAO class:


Main class (Instantiation of Objects to be stored in DB Table):
 
Rancher
Posts: 457
6
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your code throwing an exception or what?
 
Naziru Gelajo
Ranch Hand
Posts: 186
1
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Al Hobbs wrote:Is your code throwing an exception or what?



No exception is being thrown. It just does not save object data to the table. It successfully creates the table with the proper columns however.
 
Al Hobbs
Rancher
Posts: 457
6
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at the logs to see what's happening? Also, are you using NetBeans? Looks like NetBeans.
 
Naziru Gelajo
Ranch Hand
Posts: 186
1
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Al Hobbs wrote:Have you looked at the logs to see what's happening? Also, are you using NetBeans? Looks like NetBeans.



Yep, I am using Netbeans. This is the only thing I find in the logs:

 
Ranch Hand
Posts: 232
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the logs, it is not creating the tables.
But as you said it created the tables, maybe the tables already exist in db.
plus I hope you have mysql jar added to the classpath.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!