DB connection through Quip with JAVA...

Hello,

I need to connect to a Tamino Database and to query it with Quip using the Quip API for JAVA

my parameters are:
- server: lithpc3.epfl,ch
- DBname: XianDB
- collection: ino:etc

This is what I’m doing for the moment:

public class Quip {
public static void main(String [] args){

Properties obj = new Properties();

try {

String url = “lithpc3.epfl.ch/tamino/XianDB”;

obj.put(“home”,“F:/Quip/” );
obj.put(“quipcmd”,“F:/quip.exe” );

Connection Conexao = DriverManager.getConnection(url, (Properties)obj );

QueryResult Resultado = Conexao.executeQuery(“let $x := fromCollection(“ino:etc”)/News/Subject return $x”);

System.out.println(Resultado.getRawString());
}
catch (XQueryException XQEx) {
System.out.println("XQueryException: " + XQEx.getMessage());
}
}
}

and I the error message is :

XQueryException: javax/xml/parsers/DocumentBuilderFactory


Please help meeeeeeeeeeeeeeeeeee…

this looks as if you are missing out something
on your classpath. check if crimson.jar is on
your classpath, when you execute your java class.

Sven Eric

XQueryException: The executor was not found!

it means that the specified quip.exe was not found
in the file system. In Your example above you
spcified f:/quip.exe. Is this surely were your
quip.exe is?

I suspect that it should be: f:/QuiP/quip.exe

Sven Eric

I tried your own solution (the one you gave in a previous topic), which executes a query on a file dcument:

my parameters:

- filename:
- file location: F:/Xian/Diplome/Xqueries/XML/
- quip.exe location: F:/Software AG/Quip/quip.exe

and this is my code:

import java.util.;
import com.softwareag.xtools.quip.xqueryAPI.
;

public class x {

public static void main(String [] args){

Properties obj = new Properties();
StringBuffer stringbuffer1 = new StringBuffer();

try {
stringbuffer1.append( “file:XianDBfile1.xml” );

obj.put(“home”,“F:/Xian/Diplome/Xqueries/XML/” );
obj.put(“quipcmd”,“F:/Software AG/Quip/quip.exe” );

String query = “let $x := document(”+obj.getProperty(“home”)+")/News/Subject return $x";

Connection connect = DriverManager.getConnection( stringbuffer1.toString(), (Properties)obj );
QueryResult result = connect.executeQuery(query);

System.out.println(result.getRawString());

} catch (XQueryException XQEx) {
System.out.println("XQueryException: " + XQEx.getMessage());
}
}
}

and always the same error message:

XQueryException: The executor was not found!


I checked every single letter of the quip.exe location (in fact it is a copy-paste…)

I also have another question,

what does the “file:” in stringbuffer1.append( “file:XianDBfile1.xml” ); ??
ehat shoul we put if we would like to give a database url ??

I had to put the quip.exe element directly in the F:/ !! If I put it in any folder and then try to access this folder, it won’t work…

everything is ok now…
with time and patience you can do anything !!

Thank you very much Sven