"Closing a connection instance that was obtained from a pooled connection does not close the physical database connection. It does, however, free the resources of the connection instance, clear the state, close statement objects created from the connection instance, and restore the defaults for the next connection instance that will be created."
When i saw that i felt so happy then.
But at the next paragraph says;
"To actually close the physical connection, you must invoke the close() method of the pooled connection..."
I am confused.
How can i refresh a connection resources without reopening a new Connection to db?
All bets are off anything you read about other pools. You have to know how your pool behaves. If you are using any of the classic pools such as JNDI DataSource pooling, when you ask for a connection, you actually get a wrapped Connection. It's the Wrapper that returns the internal Connection to the pool on close() now if close() is called on the wrapped connection, it does physically close it.
If by refreshing the connection, you mean cause it to release any DB resources that may not have been cleaned up due to sloppy coding, there isn't any way. You must physically close the connection and create a new one. If you refactor your pool you can have it periodically close connections in the background and add new (Fresh) connections to the pool.