[Biojava-dev] JDBCPooledDataSource regression

Andy Yates ayates at ebi.ac.uk
Wed Jan 31 12:28:42 UTC 2007



Thomas Down wrote:
> 
> On 31 Jan 2007, at 12:06, Andy Yates wrote:
> 
>> Hi,
>>
>> Sorry I was meaning if that if that method just becomes:
>>
>> public static DataSource getDataSource(final String driver,
>>                                          final String url,
>>                                          final String user,
>>                                          final String pass)
>>     throws Exception {
>>
>>     BasicDataSource ds = new BasicDataSource();
>>     ds.setUrl(url);
>>     ds.setDriverClassName(driver);
>>     ds.setUsername(user);
>>     ds.setPassword(pass);
>>     // Set BasicDataSource properties such as maxActive and maxIdle, 
>> as described in
>>     // 
>> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html 
>>
>>     ds.setMaxActive(10);
>>     ds.setMaxIdle(5);
>>     ds.setMaxWait(10000);
>>
>>     return ds;
>>   }
>>
>> Does that still work?
> 
> Hmmm, I was assuming that BasicDataSource didn't actually do any pooling 
> itself, and that you needed another layer on top to manage a connection 
> pool -- that seems to be how all previous revisions of 
> JDBCConnectionPool worked, so I guess I wasn't alone in thinking this.  
> But yes, BasicDataSource does seem to do pooling itself (confirmed by 
> reading the source), so maybe your simpler version is a better idea.  It 
> certainly works okay for me.
> 
>            Thomas.

That's what I thought should have happened :). Can I suggest that this 
revised version goes into CVS? Anyone got any objections?

Andy



More information about the biojava-dev mailing list