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?
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.