docs: protected void initDataSource() {
      if (dataSource == null) {
        if (dataSourceJndiName != null) {
          try {
            dataSource = (DataSource) new InitialContext().lookup(dataSourceJndiName);
          } catch (Exception e) {
            throw new ProcessEngineException("couldn't lookup datasource from " + dataSourceJndiName + ": " + e.getMessage(), e);
          }
  
        } else if (jdbcUrl != null) {
          if ((jdbcDriver == null) || (jdbcUrl == null) || (jdbcUsername == null)) {
            throw new ProcessEngineException("DataSource or JDBC properties have to be specified in a process engine configuration");
          }
  
          PooledDataSource pooledDataSource =
              new PooledDataSource(ReflectUtil.getClassLoader(), jdbcDriver, jdbcUrl, jdbcUsername, jdbcPassword);
  
          if (jdbcMaxActiveConnections > 0) {
            pooledDataSource.setPoolMaximumActiveConnections(jdbcMaxActiveConnections);
          }
          if (jdbcMaxIdleConnections > 0) {
            pooledDataSource.setPoolMaximumIdleConnections(jdbcMaxIdleConnections);
          }
          if (jdbcMaxCheckoutTime > 0) {
            pooledDataSource.setPoolMaximumCheckoutTime(jdbcMaxCheckoutTime);
          }
          if (jdbcMaxWaitTime > 0) {
            pooledDataSource.setPoolTimeToWait(jdbcMaxWaitTime);
          }
          if (jdbcPingEnabled == true) {
            pooledDataSource.setPoolPingEnabled(true);
            if (jdbcPingQuery != null) {
              pooledDataSource.setPoolPingQuery(jdbcPingQuery);
            }
            pooledDataSource.setPoolPingConnectionsNotUsedFor(jdbcPingConnectionNotUsedFor);
          }
          dataSource = pooledDataSource;
        }
  
        if (dataSource instanceof PooledDataSource) {
          // ACT-233: connection pool of Ibatis is not properely initialized if this is not called!
          ((PooledDataSource) dataSource).forceCloseAll();
        }
      }
  
      if (databaseType == null) {
        initDatabaseType();
      }
    }