// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by ozone-db.org.
//
// The original code and portions created by SMB are
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
//
// $Id: CliTest.java,v 1.1 2001/12/18 11:04:06 per_nyfelt Exp $
import org.xmldb.api.DatabaseManager;
import org.xmldb.api.base.Collection;
import org.xmldb.api.base.Database;
/**
*
* @author <a href="http://www.smb-tec.com">SMB</a>
* @version $Revision: 1.1 $
*/
public class CliTest {
/**
*
*/
public static void main( String args[] ) throws Exception {
// load a database instance
Database xmlDB = (Database)
Class.forName( "org.ozoneDB.xml.cli.DatabaseImpl" ).newInstance();
// url schema:
//
// xmldb:ozonexml:<database>?<rootcoll>
//
// <database> can either be a directory in the local filesystem or a remote
// ip address (host:port)
// <rootcoll> specifies the name of the root collection to load
// connect to the database and return the requested root collection
Collection rootCol = xmlDB.getCollection( "xmldb:ozonexml:/home/lars/xmltest?root" );
//Collection rootCol = xmlDB.getCollection( "xmldb:ozonexml://localhost:4445?root" );
// try to load the parent collection
Collection parentCol = rootCol.getParentCollection();
if (parentCol == null)
System.out.println( "This Collection doesn't have a parental Collection!" );
}
}