1)
It slipped our attention that the API has changed
in some respects and the javaDoc got lost in our
documentation folder. I am sorry for that.
There are no longer the QuipConnection classes but
these have been replaced by the
QMachineConnection. But you do not need to bother,
if you use the DriverManager.
The following class shows how to use this and
how to set the base drectory for your queries:
import java.util.;
import com.softwareag.xtools.quip.xqueryAPI.;
public class TestAPI {
public static void main(String args){
Properties prop = new Properties();
try {
prop.put(“quipcmd”,“quip.exe” );
Connection conex
= DriverManager.getConnection( “file:c:\cygwin\home\”, prop );
QueryResult res = conex.executeQuery((String)args[0]);
System.out.println(res.getRawString());
}
catch (XQueryException e) {
System.out.println(“XQueryException: " + e.getMessage());
}
}
}
noltic that the uri in the connection is of the
form:
file:c:/…
so in this case no slashes after the first colon.
2) You noticed the whitespaces. The current quip
version keeps all whitespaces. They are
text node constructors. Actually whitespace
is a rather nasty thing. So we better keep them.
These are text-nodes.
You can avoid unwanted white-spaces
in the way you layout your query:
write:
{
$x/a/b/c
}
instead of:
{$x/a/b/c}
and write
<a
><b
/>
instead of:
3) on windows the quip.exe cannot exceed 256M
during execution. The error message you get
is actually produced by the Haskell runtime
system of ghc (Home — The Glasgow Haskell Compiler)
You can avoid this message if you set the maximum
heap size of the quip.exe to some smaller value
by the command line argument:
+RTS -M200M -RTS
In the API you set this value as command line
property:
prop.put(“qmachineoptions”,”+RTS -M200M -RTS");
However this might end up in the message:
System error: Heap exhausted
hope this helps
Sven Eric