IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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
  • 1.  static ??

    Posted Wed September 01, 2004 12:47 PM

    Hello guys, I just started to work on Tamino, so please excuse my “stupid” question.

    To start connecting to my database from a Java Application, I thought it might be a good idea to see what kind of doctypes, collections, etc. there are.

    So I wrote the following code:

    final String DATABASE_URI = “http://localhost/tamino/DBname”;
    try{
    TConnection connection = TConnectionFactory.getInstance().newConnection( DATABASE_URI );
    Iterator coll = TSchemaDefinition3Accessor.getCollectionNames();

    connection.close();
    }
    catch (Exception e){
    System.out.println( “Error” + e);
    }

    Now this gives me a message from the compiler saying:
    “The method getCollectionNames() from the type TSchemaDefinition3Accessor is not static”

    What did I do wrong?
    I also tried accessing a collection and counting everything that’s in there, which worked fine.
    So connecting works…

    Thanks for helping out!


    #API-Management
    #webMethods
    #webMethods-Tamino-XML-Server-APIs


  • 2.  RE: static ??

    Posted Wed September 01, 2004 01:46 PM

    Ah, I found my mistake. I need to do the following:

    final String DATABASE_URI = “http://localhost/tamino/DB-name”;
    try{
    TConnection connection = TConnectionFactory.getInstance().newConnection( DATABASE_URI );
    TSchemaDefinition3Accessor tsd3 = connection.newSchemaDefinition3Accessor(TDOMObjectModel.getInstance());
    Iterator coll = tsd3.getCollectionNames();
    connection.close();
    while(coll.hasNext()){
    String el = (String)coll.next();
    System.out.println(el);
    }
    }
    catch (Exception e){
    System.out.println( “Error” + e);
    }

    Well, since you couldn’t help me this time, I will make sure to post more stupid questions, so you get a chance! :slight_smile:


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods