Package org.xmldb.api.base

Examples of org.xmldb.api.base.Database


    final String driver = "org.exist.xmldb.DatabaseImpl";

    // initialize database driver
    Class cl = Class.forName(driver);
    Database database = (Database) cl.newInstance();
    database.setProperty("create-database", "true");
    DatabaseManager.registerDatabase(database);

    Collection col = null;
    XMLResource res = null;
    try {
View Full Code Here


    /**
     * Initializes XML:DB database instance using specified driver class.
     */
    public void initialize() throws Exception {
        Class c = Class.forName(driver);
        Database database = (Database)c.newInstance();
        DatabaseManager.registerDatabase(database);
    }
View Full Code Here

       }
      
       if ( commandClass != null ) {      
          try {
            // register Xindice Database with xml:db
            Database db = new DatabaseImpl();
  
            DatabaseManager.registerDatabase( db );
      
             // execute command class
             Command command = (Command)Class.forName( commandClass ).newInstance();
View Full Code Here

    try {

      Class c = Class.forName( conn.getChild("driver").getValue() );

      Database database = (Database) c.newInstance();
      DatabaseManager.registerDatabase(database);

      col = DatabaseManager.getCollection( conn.getChild("base").getValue() );

    } catch (XMLDBException e) {
View Full Code Here

        }

        if (commandClass != null) {
            try {
                // register Xindice Database with xml:db
                Database db = new DatabaseImpl();

                DatabaseManager.registerDatabase(db);

                // execute command class
                Command command = (Command) Class.forName(commandClass).newInstance();
View Full Code Here

    if (alreadyInitialized)
      return;

    String driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
    Class driverClass = Class.forName(driver);
    Database database = (Database) driverClass.newInstance();
    DatabaseManager.registerDatabase(database);
    alreadyInitialized = true;
  }
View Full Code Here

    /**
     * Initializes XML:DB database instance using specified driver class.
     */
    public void initialize() throws Exception {
        Class c = Class.forName(driver);
        Database database = (Database)c.newInstance();
        DatabaseManager.registerDatabase(database);
    }
View Full Code Here

    /**
     * Initializes XML:DB database instance using specified driver class.
     */
    public void initialize() throws Exception {
        Class c = Class.forName(driver);
        Database database = (Database)c.newInstance();
        DatabaseManager.registerDatabase(database);
    }
View Full Code Here

    /** Creates new RetrieveDocument */
    public RetrieveDocument() {
        try {
            Class c = Class.forName(driver);

            Database database = (Database) c.newInstance();
            System.out.println("Registring Database " + database);
            DatabaseManager.registerDatabase(database);
            Collection col = database.getCollection(collectionURI);
            System.out.println("Got Collection " + col);
            XMLResource resource = (XMLResource) col.getResource(resourceName);
            System.out.println("Got resource " + resource + " for " + resourceName);
           
            Document doc = (Document)resource.getContentAsDOM();
View Full Code Here

     *
     */
    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)
View Full Code Here

TOP

Related Classes of org.xmldb.api.base.Database

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.