Hallo,
ich habe folgenden Code:
try {
xmlTpl = new TemplateLoader(request);
xmlTpl.initTemplate("modules/xmlsearch/XMLSearch.tpl");
xmlTpl.setWriter(new StringWriter());
if (tt == true) {
xmlTpl.addToContext("sword",dbConnector.getResultVector("select unique obj.obj\_id, obj.abstract, obj.title, round(obj.file\_size/1024,0), to\_char(obj.accession\_date, 'DD-MM-YY') from obj\_tab obj, obj\_key\_tab key\_rel, keyword\_tab key, cross\_tab cross, obj\_author\_tab author, obj\_author\_obj\_tab author\_obj where key\_rel.obj\_id=obj.obj\_id and key\_rel.key\_id=key.key\_id and cross.cross\_id=obj.cross\_id and author.AUTHOR\_ID=author\_obj.AUTHOR\_ID and author\_obj.OBJ\_ID=obj.obj\_id and ((upper(obj.abstract) like upper('%"
+ setSword
+ "%') or upper(obj.title) like upper('%"
+ setSword
+ "%') or upper(cross.cross\_area) like upper('%"
+ setSword
+ "%') or upper(author.last\_name) like upper('%"
+ setSword
+ "%') or upper(author.first\_name) like upper('%"
+ setSword + "%')))"));
// zaehler++;
}
// Template Setzen
// xmlTpl.addToContext("sword", setSword);
xmlTpl.addToContext("defop", setDefOp);
xmlTpl.addToContext("type", setType);
xmlTpl.addToContext("resultcount", rCount(setSword, xmlTpl
.getWriter().toString()));
xmlTpl.addToContext("created", setCreated);
// TEMPLATE FERTIG
xmlTpl.mergeTemplateContext();
return xmlTpl.getWriter().toString();
} catch (SQLException e) {
logger.debug(e.getMessage());
} finally {
dbConnector.closeDbConnection();
}
Ich wollte fragen ob es möglich wäre die einzelnen objekte des selects von sword zugreifen kann, dass heisst nachdem es die Abfrage durchgeführt hat, will ich auf die Variablen obj.abstract, obj.title zugreifen. Wenn es möglich ist würde ich gerne wissen wie ich es machen soll.
Bitte im um Tipps und/oder Lösungsvorschläge
Gruß
Negi