I am a little new to DBCP and trying to figure my way out. I was looking at the the following example code at DBCP Overview
In code, that might look like this:
I had trouble comprehending why the connectionFactory and poolableConnectionFactory (which uses the connectionFactory) initialized if its never used? Am I missing something here.
If all the datasource requires is connectionPool why cant we just create connectionPool and give it to the dataSource something like this
Am I missing something here?
And also is this implementation of the dataSource thread safe? can I have multiple threads call datasource.getConnection();