Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executeUpdate Hangs One Row Insert!!!

 
Zeko Mbumwae
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to call executeUpdate() on a preparedStatement.It hangs and wont give me any output.I know for sure its executeUpdate that's a problem.
Help me.Even when I use the commented code it does not work!
Thanks

 
Nickolas Case
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps your table has a lock on it.
 
Paul Clapham
Sheriff
Posts: 21576
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "give me output" actually mean? If you aren't seeing anything from System.out.println(password) then maybe that line of code isn't being executed. Or maybe you aren't looking in the right place.

On the other hand it might mean something about the String being returned from the method. However you haven't shown any code which uses that method so maybe that code isn't working the way you think it should.

More (or better) details would help.
 
Zeko Mbumwae
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Now I am able to insert only one record upon restarting my PC and subsequently it hangs at the executeUpdate call. Please help am stuck here.

Nickolas,
There are no locks on the table I checked block=0 and request =0 on all ids.

Paul,
The System.out.print(password) prints out.By output i meant the return string from the method e.g You created a User.My TestClass is alright and calls addUser without errors.

Many thanks.

MJZ
 
Zeko Mbumwae
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code is working now.First am checking if the tuple exists then insert.What was happening is that after inserting the record I would use sqlplus to delete that record and re-run without committing the delete transaction.

How can I commit my statements automatically? statement.setAutoCommit(true) did not do it.

Thanks.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How can I commit my statements automatically? statement.setAutoCommit(true) did not do it.

It should. And if you are using the standard Oracle drivers, it does.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic