• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can not insert to DB after a while!

 
sahar sa
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear,
I have a method which every time it runs, it will add 10 row to my DB but after 3 or 4 times running this file it doesn't add anything to my db. and even it does not throw me any thing like error or ... . I dont know why cuz it works very well for first 3 or 4 times but after ....!
do you have any idea?

and some thing else! after that I can not do any thing in MySQL Command Line Client. seems that it hangs!
I realy dont know what to do!
thank you.
Sahar.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There could be any number of reasons. Without seeing the code it's all uninformed speculation, though.
 
Ranveer K Kumar
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


could you please post the code!
 
sahar sa
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi dear,
Of curse, here is the code for Insert and a piece of code which runs the insert class.

///////////insert////////////////////////////



/////////////insert call////////////



and I dont know why my MYSQL COMMAND does not work any more?!

thank you so much!
Sahar.
 
James Ward
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ranveer K Kumar
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

first check the loop; is it your real code ? then loop is here <5 increase it to <10 and please follow the James Ward update code of static connection method..


regards
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James Ward wrote:



if "conn" is declared at class level, then why is it declared again here? Furthermore, getConnection does not return a connection - it's declared void. Let's not confuse the issue by posting non-working code.
 
sahar sa
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOh my god! Dear friends specialy James Ward and Ulf Dittmer Thank you sooooooooooooo much!. I just change a little things void--> Connection and now it works!!!

Thanks again!
Sahar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic