class JDBC {

    public void setupJDBC(String dbURL, String username, String password, boolean asyncProcessing, int maxPoolSize) throws VantiqSQLException {
        try {
            if (asyncProcessing) {
                // Create a connection pool
                HikariConfig connectionPoolConfig = new HikariConfig();
                connectionPoolConfig.setJdbcUrl(dbURL);
                if (username != null) {
                    connectionPoolConfig.setUsername(username);
                }
                if (password != null) {
                    connectionPoolConfig.setPassword(password);
                }
                ds = new HikariDataSource(connectionPoolConfig);
                ds.setConnectionTimeout(CONNECTION_POOL_TIMEOUT);

                // Setting max pool size (should always match number of active threads for publish and query)
                ds.setMaximumPoolSize(maxPoolSize);
            } else {
                // Open a single connection
                conn = DriverManager.getConnection(dbURL,username,password);
            }
            
            // Save login credentials for reconnection if necessary
            this.dbURL = dbURL;
            this.username = username;
            this.password = password;
            this.isAsync = asyncProcessing;
        } catch (SQLException e) {
            // Handle errors for JDBC
            reportSQLError(e);
        } 
    }

}