• 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

executing an update sql takes too long , what is problem ?

 
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post
My problem is :
Im trying to execute an update statement over a table in Derby database.
when i call executeUpdate()
it goes away and die (no exception , no data update happens)
I tried and used same query string (changed to fit the insert operation)
to insert data into database and it inserted successfylly.

I used Datasource , and PreparedStatement for updating , am i correct ?

and other parameter are set as the above.

when i execute the statement with executeUpdate() it dies

is there any method that i can see what is the sql string that the prepared statement is executing ?

thank you
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raminaa,
It is possible that some other process has a lock on the row you are trying to update. You are correct in using DataSource and PreparedStatement.

In your example, you only show the setting of one parmeter. In you real code, I assume you set all 4. Otherwise, the code would throw an exception. Also note that it is unnecessary to set EMPNO in the update query since that is what you are searching on and it isn't changing.

For testing, you could just write the query without any "?" so you know what is being executed. Or you could use a DebuggableStatement (search this forum for details.) I think that may be overkill here though.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My experience:

i)



ii) Are there any
Indexes or such constraints on the table to be updated?

bye.
Yilmaz
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic