Dear All,
I got an application which have many sql select statement and some are done withing the outler select statement. The problem is that sometimes I get this error com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after statement closed.? What could be the cause is it because I am using the statements wrongly?
newbie14
0
Posting Pro
Recommended Answers
Jump to Post@Anuradha Mandal then do not reply or use Google search to come up with some reasonable answer.
@newbie14 sound like you are relaying on open connection that on MySQL in ideal situation will be open for up to 8 hours but then it is closed. You can amend that …
Jump to PostBeside that point I would like to ask is my use of statements is correct or not?
>> How would I know, I didn't see any codeBut I am curious is why only sometimes it happens then once I reset the server everthing moves fine that is why …
Jump to Postyou closing "stmt" in one of another subquery statements
1/ you have to declare stmt twice because concur thread that used statemet can closed that as you can see in your error from JDBC Driver
2/ declare only variables valid for concrete try-catch-finally block or void
All 9 Replies
Anuradha Mandal
-28
Junior Poster
newbie14
0
Posting Pro
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
Anuradha Mandal
commented:
N/A.
+0
newbie14
0
Posting Pro
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
newbie14
0
Posting Pro
mKorbel
274
Veteran Poster
newbie14
0
Posting Pro
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.