⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clitest.java

📁 Java的面向对象数据库系统的源代码
💻 JAVA
字号:

// 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 2003/11/22 19:29:51 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!" );

        
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -