Home » Server Options » Text & interMedia » Simple Java Query API Example?
Simple Java Query API Example? [message #76174] Tue, 11 January 2005 02:32
Sebastian Odrich
Messages: 1
Registered: January 2005
Junior Member
Oracle Ultrasearch 10g

I have to write a java util that is startet with a parameter (query-string) and returns the result for this query (plain text).

I read the oracle sampla query application an try this:

// 'QueryInstance' erzeugen und Verbindung definieren
QueryInstance queryInstance = new QueryInstance();

// 'InstanceMetaData' auslesen
InstanceMetaData instMD=null;
try {
instMD = queryInstance.getMetaData();
} catch (SQLException e) {

// 'Contains' erzeugen
Contains contains = new Contains(query,instMD);

// 'Request' erzeugen
// Request mit Informationen füllen

Attribute title = instMD.getStringAttribute("title");
Attribute author = instMD.getStringAttribute("author");
Attribute description = instMD.getStringAttribute("description");
Attribute [[]] attreq = { title, author, description };

Group[[]] groups;
groups = new Group[[instMD.getGroups().size()]];
for (int i=0; i<instMD.getGroups().size();i+=1) {
groups[[i]] = (Group)instMD.getGroups().toArray()[[i]];
Query filter = new From(groups);

Request request = new Request();
request.setStartIndex(1); // hier kann jeder beliebige Wert>= 1 stehen
request.setDocsRequested(maxRows); // Anzahl der anzuzeigenden Dokumente
request.setStartTag ("");
request.setEndTag ("
request.setEllipsisMark (" ... ");

// 'Result' abfragen
Result result = null;
try {
result = queryInstance.getResult(request);
} catch (SQLException e1) {

The Sampla jsp-application workes fine.
When my program tries to resolve the result from the instance this exception is thrown:

java.sql.SQLException: ORA-20000: Oracle Ultra Search-Fehler
ORA-00936: missing expression
ORA-06512: at "WKSYS.WK_ERR", line 179
ORA-06512: at "WKSYS.WK_QRY", line 1007
ORA-06512: at line 1
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)
at oracle.jdbc.ttc7.TTC7Proto .doOall7(TTC7Protocol.java:1894)
at oracle.jdbc.ttc7.TTC7Proto .parseExecuteFetch(TTC7Protocol.java:1094)

Is anybody out there able to help me?
Has anyone out there a simple java query example to get a result from oracle ultrasearch
Previous Topic: C/C+ Sample Program for Oracle in Linux
Next Topic: very urgent - INDEXING/REINDEX
Goto Forum:

Current Time: Fri May 07 19:32:10 CDT 2021