} else { System.err.println("No Driver parameter specified for " + dbType + " - using default driver - " + DEFAULT_DB_DRIVER); DBConnectionPool.registerDriver(DEFAULT_DB_DRIVER);
  public void executeSQL(String rawSql, QueryHandler qh) {    try {      String dbname = qh.getParameter("Database");      if (dbname == null) {	throw new RuntimeException("No Connection parameter.");      }      //WAN find the dbtype by using the value of the dbname delete later      //String dbtype = getDBType(dbname); delete later      if (dbType == null) {	throw new RuntimeException("No Connection parameter. - No dbtype");      }      String driver = Parameters.findParameter("driver."+dbType);//WAN  must go directly to cougaar.rc now      if (driver != null) {	DBConnectionPool.registerDriver(driver);      }      // do Param substitution      String sql;      sql = produceQuery(qh, rawSql);            Properties props = new Properties();      String user = qh.getParameter("Username");      if (user == null) user = qh.getParameter("user");      String pass = qh.getParameter("Password");      if (pass == null) pass = qh.getParameter("password");      if (user == null || pass == null)	throw new RuntimeException("Incomplete user/password parameters");      props.put("user", user);      props.put("password", pass);      Connection conn = DBConnectionPool.getConnection(dbname, user, pass);      try {        Statement statement = conn.createStatement();        ResultSet rset = statement.executeQuery(sql);        ResultSetMetaData md = rset.getMetaData();        int ncols = md.getColumnCount();        Object row[] = new Object[ncols];        while (rset.next()) {	  for (int i = 0; i < ncols; i++)            row[i] = rset.getObject(i+1);	  qh.processRow(row);        }        statement.close();      } catch (SQLException sqe) {        System.err.println("executeQuery failed: " + sql);      } finally {        conn.close();      }    } catch (Exception e) {      System.err.println("Caught exception while executing a query: "+e);      e.printStackTrace();    }  }