On Fri, Sep 19, 2008 at 3:08 PM, Tak-po Li <[EMAIL PROTECTED]> wrote: > > Thanks, Natalia, I have a few questions on Addcontact.java: > > // Create the XMLResource and store the document > XMLResource resource = (XMLResource) col.createResource( "", > "XMLResource" ); > resource.setContent(ourdoc); > col.storeResource(resource); > I believe ourdoc is the xml string. However, I believe this is for > addressbook data base only. How should I change it to a database name > "cad"?
You are correct, ourdoc variable contains an xml string. To store a document in a different collection, you just need to get a different collection instance from a database, the code above does not need to change. The collection instance used by addressbook is initialized in DBConnection.java. In that class, application accesses a collection xmldb:xindice://localhost:8080/db/addressbook, so it needs to be changed to xmldb:xindice://localhost:8080/db/cad. Don't forget to create this collection before trying to access it from the application. Regards, Natalia > Thanks, > > Tak