jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: building strong queries
Date Fri, 21 Dec 2007 13:30:30 GMT
Daniele Dellafiore wrote:
> Today I encounter and solved, searching the mauiling list, some
> "escape char" problem in my queries.
> Now, I am wondering if there is a common way to build strong queries,
> some equivalent of PreparedStatement in JDBC, where you set the
> property name and then add values with "addString" and such and the
> builder knows how to fill the query.

this is currently not possible. but once JSR 283 is implemented in Jackrabbit 
you can use parametrized query statements:

QueryManager qm = ....;
String stmt = "//element(*, nt:resource)[jcr:contains(., $exp)]";
Query q = qm.createQuery(stmt, Query.XPath);
q.bindValue("exp", "jackrabbit");
q.execute();

regards
  marcel

Mime
View raw message