• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC connection fail-ERROR: Cannot get a connection, pool error Timeout waiting for idle objec

 
aish sharma
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI All,


Please read the below data carefully and help me to solve error.


I have created one loop which will call the below function multiple times. First time the function is working properly but in second time i am unable to connect to the database . I think the problem is at conn = ds.getConnection(); . Because in second time i am able to print the value up to

System.out.println("connection 1,2 is null"); It is not going to print the statement -->System.out.println("con value is");

please help me ... why i am not getting the value of conn second time.


See the below code.




 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You never close the connection. It's recommended you to so in a finally block immediately after you finish using it.
 
aish sharma
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Scott Selikoff

Thanks for the help!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic