Example #1
0
  /** Creates all database connections used for data collection */
  protected void connect() throws Throwable {
    // The context holds agent configuration and its custom data
    AgentConfiguration agentCfg = fContext.getAgentConfiguration();
    SQLODBCConfiguration cfg =
        (SQLODBCConfiguration) fContext.getAgentConfiguration().getAgentCustomConfiguration();

    // Create more connections to the same database
    for (int i = 0; i < numConnections; i++) {
      Connection conn =
          DriverManager.getConnection(cfg.getConnectionString(agentCfg.getMonitoredHost()));
      this.connections.add(conn);
    }
  }