BTW, you can find out the error codes here http://www.xmldb.org/xapi/idl/base.idl. Also if you print out e.message it should give you more information. The error you're seeing is because it can't locate the database impl.
Yeah, I know it's confusing right now. We'll get an actual xindice release out real soon now and then dbXML can take its place in history. The main holdup is that we need to get the website setup on the Apache side before we do the release.
On Tuesday, February 5, 2002, at 10:46 AM, Richard Featherstone wrote:
I've created the collection and added a few documents.� I've queried the collection from the command line and get the right results.� I'm no trying to do the same thing from a Java program to get to grips with the XML:DB Api.� The code I'm using is below.� Any ideas where I'm going wrong will be gratefully received.
�
Cheers
�
Richard
�
import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;
�
public class ConnectToDbxml {
�
��� /**� */
��� public static void main(String args[]) throws Exception {
�������
������� Collection col = null;
�������
������� try{
����������� String driver = "org.dbxml.client.xmldb.DatabaseImpl";
����������� Class c = Class.forName(driver);
�������
����������� Database database = (Database)c.newInstance();
����������� DatabaseManager.registerDatabase(database);
�����������
����������� col = DatabaseManager.getCollection("xmldb:xindice:///db/myexamples");
�������
����������� String xpath = "/person";
����������� XPathQueryService service = (XPathQueryService)col.getService(
"XPathQueryService", "1.0");
�����������
����������� ResourceSet resultSet = service.query(xpath);
�����������
����������� ResourceIterator results = resultSet.getIterator();
����������� while(results.hasMoreResources()){
��������������� Resource res = results.nextResource();
��������������� System.out.println((String)res.getContent());
����������� }
������� }
������� catch (XMLDBException e) {
����������� System.err.println("XML:DB Exception occured " + e.errorCode)
;
������� }
������� finally {
����������� if (col != null) {
��������������� col.close();
����������� }
������� }
��� }
}
----- Original Message ----- From: Mark J. Stang To: [email protected] Sent: Tuesday, February 05, 2002 5:39 PM Subject: Re: exception error code
It means something didn't work :-).�� I don't mean that in a bad way, I think you get that error for many different types of problems.
Have you created the collection "myexamples"?
Try
dbxmladmin lc -c /db
It should list your collections.
Try "getting" one of the ones that are in the list.
HTH,
Mark
Richard Featherstone wrote:
Hi�Hope someone can help�In a Java program I try and call���� col = DatabaseManager.getCollection("xmldb:dbxml:///db/myexamples");�and I get�
��� XML:DB EXCEPTION: occured 1�can anyone tell me what error code 1 is so I can try to trace the problem�Cheers�Richard
Kimbro Staken XML Database Software, Consulting and Writing http://www.xmldatabases.org/
