• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

update statement is time consuming???

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my project, update statement is taking too much time, what can I do, I can't avoid it because I need to update a field of table....

Please comments...

Thanks.
 
Aaron Ting
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rathi ji:
Hi,

In my project, update statement is taking too much time, what can I do, I can't avoid it because I need to update a field of table....

Please comments...

Thanks.


Greetings rathi ji,

Depending on how you are actually updating your database, is it through a java program or otherwise? Do state the mode of updating you are adopting in your project, and, what type of database you are using in order to let the ranchers advise you more accurately..

On the other hand, if you are using a java program to update the database, i personally feel that it would be better if you could do a test out on your query statement first before using it. This would help you in ensuring that possible syntax error(s) from occuring, which might pose as an issue while executing them.

*just my 2 cents worth*
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Aaron Ting:


Greetings rathi ji,

Depending on how you are actually updating your database, is it through a java program or otherwise? Do state the mode of updating you are adopting in your project, and, what type of database you are using in order to let the ranchers advise you more accurately..

On the other hand, if you are using a java program to update the database, i personally feel that it would be better if you could do a test out on your query statement first before using it. This would help you in ensuring that possible syntax error(s) from occuring, which might pose as an issue while executing them.

*just my 2 cents worth*


Yes, I am doing this in a Java program. Query working fine at SQL prompt. Program not even giving General Error. It just take too much (infinite) time to complete operation.

Please comments...

Thanks.

 
pengpeng lin
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can try to Update the field of table in the database's store rocedure,
and then call the store procedure in the java code.
 
Aaron Ting
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings rathi,


Is it possible if you post up the codings... ?

So, maybe, we can just take a look and find it there is any error with your java class...

Besides the java class, i don't see anymore reasons why the execution of the query is taking you infinite time to process...
 
Sri Ram
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
If u are using SQL Server, get the execution plan for the query. check if the query itself is taking time rather than checking the java class. If the query takes time, check if necessary indexes are present.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic