Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to Insert row into MySql database

 
Subbarao Kondabala
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Below is my code



When I run the above program row is not inserting into mysql database, but at eclipise console I am getting success message without any exception. I configuried required xml files and POJO class correctly.

Can any please help me out to reolve this issues

Thanks in Advance

Subbarao Kondabala
[ August 11, 2008: Message edited by: Paul Sturrock ]
 
King Amit
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

try and put your query statement inside a transaction.

For example

Transaction tx = session.openTransaction();

// do all the stuff here

tx.commit();

// check for the syntax and proper methods.
see if it works in eclipse.
 
Subbarao Kondabala
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi King,

Thanks Very Much.

My problem gor resolved.

As you suggested

Transaction tx = session.openTransaction();
(Instead of this statement I written
Transaction tx = session.beginTransaction(); because session.openTransaction(); is not avaliable in the jar file I am using )

// do all the stuff here

tx.commit();

So by using session.openTransaction(); My problem solved.

Thanks once again King for your help

Take care and Bye

Subbarao Kondabala
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic