DOM/JDOM/SAX

I’m confused about DOM JDOM and SAX.
I know that sax works by events and dom and jdom by tree of document.

I’m creating a more level class named DATABASE
with method Query (for the moment)i have to insert also INSERT;DELETE;UPDATE etc…
The constructor of my class is:

public Database(String databaseURI,
String collection) throws TConnectionException {
// Obtain the connection factory
TConnectionFactory connectionFactory =
TConnectionFactory.getInstance();
// Obtain the connection to the database
connection = connectionFactory.newConnection( databaseURI );
// Obtain the concrete TXMLObjectAccessor using the JDOM object model
accessor = connection.newXMLObjectAccessor(
TAccessLocation.newInstance( collection ) ,
TJDOMObjectModel.getInstance() );
}

the method query is:
private TResponse Query(String s) throws Exception {
TQuery query = TQuery.newInstance( s );
try {
// Invoke the query operation
return accessor.query( query );
}
catch (TQueryException queryException) {
// Inform about the reason for the failure
showAccessFailure(queryException);
return null;
}
}
how can i do insert,delete etc?
Have i to use TaminoClient?
If someone can post same code example is welcome.

Ciao
@nto

There are examples that come with the documentation, for example the ProcessXMLGreeting.java shows insert, update etc. This can be found in the \Help\INOAPI\LISTINGS\HELLO directory.

Also check out the “java API migration cookbook” that I posted to these forums - this contains a number of examples including insert, update and delete.

You don’t need to use the TaminoClient Api if you are using the TaminoAPI4J, in fact is best not to use both in the same application. Best to stick with the TaminoAPI4J :wink:


Stuart Fyffe-Collins
Software AG (UK) Ltd.