Query in Java Client API

Hi,

I’ve written a query somthin like

http://localhost/tamino/MyStore/Telephone/Telephone?_xql=Telephone[LoginName=‘Weber315’]

and I get a record using the Browser.

When I try the same in the Java Client like

TaminoResult tr = tamino.query(“Telephone[LoginName=‘Weber315’]”);

I get no records.

Regards
Pushparajan

Hi,

a good way to figure out what might be going wrong with queries is to take a look at the webserver’s access log. Since the Java API “merely” wraps a HTTP command, chances are that the _xql= shows up in the log, and you see where the trouble comes from.

(in this case I find the escaped single quote inside the string delimiter very suspicous …)

Best regards, Andreas

Hi,

I checked the access log file, I makes entries of those accessed directly by the browser and the connect entries from the JAVA api, the following queries are not logged.

the following does not fetch results
TaminoResult tr = tamino.query(“Telephone[Lastname=“Weber”]”);
OR
TaminoResult tr = tamino.query(“Telephone[Lastname=Weber]”);

and the following retrieves the record.

TaminoResult tr = tamino.query(“Telephone[EntryID=315]”);
(Both are text nodes)

Is it a problem with the way I handle strings or Is this a bug.

Regards
Pushparajan

Hi,

I used the ~ operator and have the correct result.

Telephone[LoginName~=“Weber315”]

Regards
Pushparajan

Hi,

Did you try single quotes (’) instead of double ones (") and not escaped with a backslash?

TaminoResult tr = tamino.query(“Telephone[LoginName=‘Weber315’]”);

(I didn’t try it, so it’s just a guess)

regards,
Pieter

Hi,

I did try ’ but does not work with the java client api.

thanks
Pushparajan