Click here to Skip to main content
15,905,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
void function(Httpsession session){
session.getAttribute("name");
Access_mysql();//this function access two tables in database

}

MysqlException:no operation is allowed after connection is closed.

What I have tried:

Without session it is working fine.
Posted
Comments
Richard MacCutchan 13-May-17 7:29am    
That makes no sense; what is the connection between those two statements?
Member 11945275 13-May-17 7:33am    
I am sorry ,it means whenever I login using database and makes a session than unable to access that database again.
Richard MacCutchan 13-May-17 7:36am    
Well I am sorry, but there is no way anyone here can guess what is happening in your code.
Member 11945275 13-May-17 7:51am    
Thank you for at least attending my question.
And I got the solution.
Actually it was a problem with class for my connection to the database.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900