how to return connection to pool

user920420 picture user920420 · Aug 30, 2011 · Viewed 8.5k times · Source

do we need to call any method on dbcp.BasicDataSource or jndi datasource(i'm using jboss) to return the connection after done with it?

Answer

skaffman picture skaffman · Aug 30, 2011

Nope, just call Connection.close(). If this connection was obtained from a pooled data source, then it won't actually be closed, it'll just be returned to the pool.