segui os passos corretamente porém ao clicar no play no console só mostra essas 4 ultimas linhas
import java.sql.SQLException;
public class TestaConexao {
public static void main(String[] args) throws SQLException, InterruptedException {
ConnectionFactory conexao = new ConnectionFactory();
for (int i = 0; i < args.length; i++) {
conexao.recuperarConexao();
System.out.println("TESTANDO REQUISIÇOES " + i );
}
Thread.sleep(30000);
}
}
import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import com.mchange.v2.c3p0.ComboPooledDataSource;
public class ConnectionFactory {
public DataSource dataSource;
public ConnectionFactory() {
ComboPooledDataSource poolDataSource = new ComboPooledDataSource();
poolDataSource.setJdbcUrl("jdbc:mysql://localhost/loja_virtual?useTimezone=true&serverTimezone=UTC");
poolDataSource.setUser("root");
poolDataSource.setPassword("root");
poolDataSource.setMaxPoolSize(15);
//criando um pool de conexões para acessos de varios usuarios atrelados a data source
this.dataSource = poolDataSource;
}
public Connection recuperarConexao() throws SQLException {
return this.dataSource.getConnection(); //chamando a conexao do data source
}
}
abr. 12, 2021 11:24:34 PM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
abr. 12, 2021 11:24:36 PM com.mchange.v2.c3p0.C3P0Registry
INFO: Initializing c3p0-0.9.5.4 [built 23-March-2019 23:00:48 -0700; debug? true; trace: 10]