webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

JAVA - Quip - XQuery - Database, the solution !

  • 1.  JAVA - Quip - XQuery - Database, the solution !

    Posted Wed January 16, 2002 07:00 PM

    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());
    }
    }
    }


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: JAVA - Quip - XQuery - Database, the solution !

    Posted Thu August 01, 2002 12:49 PM

    hello,

    I tried to run the above program. but i am getting the following exception.

    Exception in thread “main” java.lang.NullPointerException
    at testQuip.main(testQuip.java:16)

    And even i am trying to print the connction obj then it is giving as null.

    I used the same program by connction to the local hard disk uri then it is working fine.

    Thanks
    dhiraja


    #Tamino
    #API-Management
    #webMethods


  • 3.  RE: JAVA - Quip - XQuery - Database, the solution !

    Posted Mon February 23, 2004 10:35 AM

    Hello,

    Could you please give me a hand?
    I tried to run this program and got the same error message.
    What I want to do is just trying to query a xml file, but it can’r work.

    Thank you,
    Chandler


    #API-Management
    #webMethods
    #Tamino