Here is a sample code to connect to a Database and make some “XQueries” through Quip with JAVA…enjoy !
my parameters are:
- sever: http://localhost/tamino
- DBname: XianDB
- collection: ino:etc
- quip.exe loc: F:/Quip/quip.exe
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 {
String x = “http://localhost/tamino/XianDB” ;
obj.put(“quipcmd”,“F:/Quip/quip.exe” );
String query = “let $x := fromCollection("ino:etc")/News/Subject return $x”;
Connection connect = DriverManager.getConnection( x, (Properties)obj );
QueryResult result = connect.executeQuery(query);
System.out.println(result.getRawString());
} catch (XQueryException XQEx) {
System.out.println("XQueryException: " + XQEx.getMessage());
}
}
}