static ??

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!

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: