Tentei fazer um pool de conexões com o driver mysql e tive o seguinte erro.
public static void main(String args[]) throws Exception {
ComboPooledDataSource connectionPoolDatasource = new ComboPooledDataSource();
connectionPoolDatasource.setDriverClass("com.mysql.jdbc.Driver");
connectionPoolDatasource.setJdbcUrl("jdbc:mysql://localhost:3306/loja-virtual");
connectionPoolDatasource.setUser("root");
connectionPoolDatasource.setPassword("8508");
connectionPoolDatasource.setMinPoolSize(1);
connectionPoolDatasource.setAcquireIncrement(5);
connectionPoolDatasource.setMaxPoolSize(20);
Connection con = connectionPoolDatasource.getConnection();
}
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/pool2/PooledObjectFactory
at br.com.alura.jdbc.Databaseteste2.main(Databaseteste2.java:12)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.pool2.PooledObjectFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more