This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Spring Hibernate - Not Saving to Database Table via HibernateTemplate  RSS feed

 
Ranch Hand
Posts: 186
1
Java Netbeans IDE 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: 427
6
Fedora IntelliJ IDE Spring
  • 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
Java Netbeans IDE 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: 427
6
Fedora IntelliJ IDE Spring
  • 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
Java Netbeans IDE 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: 204
  • 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.
 
My, my, aren't you a big fella. Here, have a tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!