• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

executeUpdate Hangs One Row Insert!!!

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps your table has a lock on it.
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic