I am working with Java Swing & I importrf the mssql jdbc & proxool libraries for database connection & pooling.
I need to make connection with SQL Server through database pooling but it's returning and exception DriverManager.getConnection(url, info);
No suitable driver found for proxool.DBConnectionAlias:com.microsoft.sqlserver.jdbc.SQLServerDriver:jdbc:sqlserver://localhost:1433;databaseName=test_ERP; trustServerCertificate=true
public final class ConnectionPool {
public ConnectionPool() throws Exception {
// Set up the URL
String alias = "DBConnectionAlias";
String driverClass = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
String driverUrl = "jdbc:sqlserver://localhost:1433;databaseName=test_ERP; trustServerCertificate=true";
String url = "proxool." + alias + ":" + driverClass + ":" + driverUrl;
// Set up the Properties object
Properties info = new Properties();
info.setProperty("proxool.maximum-connection-count", "30");
info.setProperty("user", "test_Admin");
info.setProperty("password", "#test");
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection connection = DriverManager.getConnection(url, info);
connection.close();
// Add a connection listener to the pool
ProxoolFacade.addConnectionListener(alias, new ConnectionListener());
}
public Connection getConnection() throws SQLException {
// Use the alias "demo" defined in the constructor to borrow a connection
return DriverManager.getConnection("proxool.DBConnectionAlias");
}
}