Hello!
I have been trying to update my tamino db, unfortunately I haven’t achive any success!
Here is my sample code:
-----------------------------------------------
import java.util.;
import org.w3c.dom.;
import com.softwareag.tamino.API.dom.*;
public class update {
public static final void main(String arg) throws Exception {
TaminoClient tc = new TaminoClient(“http://localhost/tamino/mydb/col”);
tc.setPageSize(0);
tc.startSession();
try {
TaminoResult tr = tc.query(“doc[id_client=‘12345’]”);
Document dc = tr.getDocument();
Element el = dc.getDocumentElement();
NodeList nl = el.getElementsByTagName(“surname”).item(0).getChildNodes();
String OldNodeValue = nl.item(0).getNodeValue();
String NewNodeValue = “KOWALSKI”;
nl.item(0).setNodeValue(NewNodeValue);
tc.process(el);
tc.commit(true);
tc.endSession();
} catch (com.softwareag.tamino.API.dom.TaminoError Error) {
System.err.println("Tamino Error Code: " + Error.responseCode + “\n” +
"Tamino Error Text: " + Error.errorText);
}
}
}
-----------------------------------------------
I tried to modify value using tagname “surname” to “KOWALSKI” string value.
I used process method which should update my db.
In documentation I found:
-----------------------------------------------
public final TaminoResult process(org.w3c.dom.Element element)
throws java.io.IOException, TaminoError
The process method will attempt to store the element using HTTP/1.1 POST and the _process verb. If the attribute ino:id is set to a numeric value in the domain of ino IDs, the element will overwrite the element with this ID if it already exists, or it will be inserted with this ino:id. If no ID is present, a unique ID will be assigned. A Tamino Result object is returned. The document type and the ino:id can be extracted from the Result object.
Parameters:
a - DOM element containing XML to process.
Returns:
the Tamino Result Object containing the DOM Object
Throws:
the - Tamino error object
the - IOException object
-----------------------------------------------
Please help me!
Any help will be appreciated!
Thanks a lot in advance!
best regards,
Dariusz Baumann
#API-Management#webMethods-Tamino-XML-Server-APIs#webMethods