String q = "SELECT "+namefield+" FROM "+table+" ORDER BY "+namefield;
String q = new StringBuffer("SELECT ") .append(namefield) .append(" FROM ") .append(table) .append(" ORDER BY ") .append(namefield) .toString();
    public Vector getPropertyNames (Node home, Relation rel) throws Exception {	// Transactor tx = (Transactor) Thread.currentThread ();	// tx.timer.beginEvent ("getNodeIDs "+home);	if (rel == null || rel.otherType == null || !rel.otherType.isRelational ()) {	    // this should never be called for embedded nodes	    throw new RuntimeException ("NodeMgr.getPropertyNames called for non-relational node "+home);	} else {	    Vector retval = new Vector ();	    // if we do a groupby query (creating an intermediate layer of groupby nodes),	    // retrieve the value of that field instead of the primary key	    String namefield = rel.accessor;	    Connection con = rel.otherType.getConnection ();	    String table = rel.otherType.getTableName ();	    Statement stmt = null;	    try {	        String q = "SELECT "+namefield+" FROM "+table+" ORDER BY "+namefield;	        stmt = con.createStatement ();	        if (logSql)	           app.logEvent ("### getPropertyNames: "+q);	        ResultSet rs = stmt.executeQuery (q);	        while (rs.next()) {	            String n = rs.getString (1);	            if (n != null)	                retval.addElement (n);	        }	    } finally {	        // tx.timer.endEvent ("getNodeIDs "+home);	        if (stmt != null) try {	            stmt.close ();	        } catch (Exception ignore) {}	    }	    return retval;	}    }