query += '"' + key[i].toString() + '"';
query += '\'' + key[i].toString() + '\'';
  protected void loadCache(ResultProducer rp, Object[] key)    throws Exception {    System.err.print(" (updating cache)"); System.err.flush();    m_Cache.removeAllElements();    m_CacheKey = null;    String query = "SELECT Key_" + m_CacheKeyName      + " FROM " + m_ResultsTableName;    String [] keyNames = rp.getKeyNames();    if (keyNames.length != key.length) {      throw new Exception("Key names and key values of different lengths");    }    m_CacheKeyIndex = -1;    for (int i = 0; i < keyNames.length; i++) {      if (keyNames[i].equalsIgnoreCase(m_CacheKeyName)) {	m_CacheKeyIndex = i;	break;      }    }    if (m_CacheKeyIndex == -1) {      throw new Exception("No key field named " + m_CacheKeyName			  + " (as specified for caching)");    }    boolean first = true;    for (int i = 0; i < key.length; i++) {      if ((key[i] != null) && (i != m_CacheKeyIndex)) {	if (first) {	  query += " WHERE ";	  first = false;	} else {	  query += " AND ";	}	query += "Key_" + keyNames[i] + '=';	if (key[i] instanceof String) {	  query += '"' + key[i].toString() + '"';	} else {	  query += key[i].toString();	}      }    }    if (execute(query)) {      ResultSet rs = getResultSet();      while (rs.next()) {	String keyVal = rs.getString(1);	if (!rs.wasNull()) {	  m_Cache.addElement(keyVal);	}      }      rs.close();    }    m_CacheKey = (Object [])key.clone();  }