if (logSql) { app.logEvent("### insertNode: " + insertString); }
    protected void insertRelationalNode(Node node, DbMapping dbm, Connection con)                throws ClassNotFoundException, SQLException {        if (con == null) {            throw new NullPointerException("Error inserting relational node: Connection is null");        }        String insertString = dbm.getInsert();        PreparedStatement stmt = con.prepareStatement(insertString);        // app.logEvent ("inserting relational node: "+node.getID ());        DbColumn[] columns = dbm.getColumns();        String nameField = dbm.getNameField();        String prototypeField = dbm.getPrototypeField();        if (logSql) {            app.logEvent("### insertNode: " + insertString);        }        try {            int stmtNumber = 1;            // first column of insert statement is always the primary key            stmt.setString(stmtNumber, node.getID());            Hashtable propMap = node.getPropMap();            for (int i = 0; i < columns.length; i++) {                Relation rel = columns[i].getRelation();                Property p = null;                if (rel != null && propMap != null && (rel.isPrimitive() || rel.isReference())) {                    p = (Property) propMap.get(rel.getPropName());                }                String name = columns[i].getName();                if (!((rel != null) && (rel.isPrimitive() || rel.isReference())) &&                        !name.equalsIgnoreCase(nameField) &&                        !name.equalsIgnoreCase(prototypeField)) {                    continue;                }                stmtNumber++;                if (p!=null) {                    this.setStatementValues (stmt, stmtNumber, p, columns[i].getType());                } else if (name.equalsIgnoreCase(nameField)) {                    stmt.setString(stmtNumber, node.getName());                } else if (name.equalsIgnoreCase(prototypeField)) {                    stmt.setString(stmtNumber, node.getPrototype());                } else {                    stmt.setNull(stmtNumber, columns[i].getType());                }            }            stmt.executeUpdate();        } finally {            if (stmt != null) {                try {                    stmt.close();                } catch (Exception ignore) {}            }        }    }