• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem in insert query

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone! I'm developing my first java application using hibernate. I'm stuck with this problem and I can't figure out where's my mistake, so if someone has any idea it would be very helpful.

Basically,my code is properly excuted, but each and every excution time previous data from the table is deleted from the database and new data is inserted into the db. Please suggest me.

i am using Oracle 10g database server.

Please check the below code.
---------------------------------------------------------------------------
in HibernateUtil class
---------------------------------------------------------------------------

---------------------------------------------------------------------------
in DataManger class
---------------------------------------------------------------------------

---------------------------------------------------------------------------
in Mapping file
---------------------------------------------------------------------------


---------------------------------------------------------------------------
in Configuration File Hibernate.cfg.xml
---------------------------------------------------------------------------


--------------------------------------
Best Regards,
Amit Sharma
[ December 17, 2008: Message edited by: Paul Sturrock ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Basically,my code is properly excuted, but each and every excution time previous data from the table is deleted from the database and new data is inserted into the db. Please suggest me.


From your hibernate.cfg.xml:


This means your tables will be removed everytime your restart your application. If you want Hibernate to do DDL stuff, you might consider changing this value to update.
[ December 17, 2008: Message edited by: Paul Sturrock ]
 
amishrm sharma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul..
it's working now.
 
Evil is afoot. But this tiny ad is just an ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic