Package org.xmldb.api.base

Examples of org.xmldb.api.base.Database


  /** <p>Performs the database collection and invokes
   * {@link DatabaseManager#getCollection(String)}.</p>
   */
  protected Collection getXmlDbCollection()
      throws XMLDBException, IllegalAccessException, InstantiationException {
    Database database = (Database) getDriverClass().newInstance();
    if (databaseProperties != null) {
      for (Iterator iter = databaseProperties.entrySet().iterator();  iter.hasNext()) {
        Map.Entry entry = (Map.Entry) iter.next();
        database.setProperty((String) entry.getKey(), (String) entry.getValue());
      }
    }
    DatabaseManager.registerDatabase(database);
    return DatabaseManager.getCollection(getCollection());
  }
View Full Code Here


  /** Returns the database collection by invoking
   * {@link DatabaseManager#getCollection(String)}.
   */
  protected Collection getXmlDbCollection()
      throws XMLDBException, IllegalAccessException, InstantiationException {
    Database database = (Database) getDriverClass().newInstance();
    if (databaseProperties != null) {
      for (Iterator iter = databaseProperties.entrySet().iterator();  iter.hasNext()) {
        Map.Entry entry = (Map.Entry) iter.next();
        database.setProperty((String) entry.getKey(), (String) entry.getValue());
      }
    }
    DatabaseManager.registerDatabase(database);
    return DatabaseManager.getCollection(getCollection());
  }
View Full Code Here

            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Initializing XML:DB connection, using driver " + driver);
            }

            try {
                Database db = (Database)Class.forName(driver).newInstance();

                Configuration[] params = drivers[i].getChildren();
                for (int j = 0; j < params.length; j++) {
                    db.setProperty(params[j].getName(), params[j].getValue());
                }

                DatabaseManager.registerDatabase(db);

            } catch (XMLDBException e) {
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

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

  /** <p>Performs the database collection and invokes
   * {@link DatabaseManager#getCollection(String)}.</p>
   */
  protected Collection getXmlDbCollection()
      throws XMLDBException, IllegalAccessException, InstantiationException {
    Database database = (Database) getDriverClass().newInstance();
    if (databaseProperties != null) {
      for (Iterator iter = databaseProperties.entrySet().iterator();  iter.hasNext()) {
        Map.Entry entry = (Map.Entry) iter.next();
        database.setProperty((String) entry.getKey(), (String) entry.getValue());
      }
    }
    DatabaseManager.registerDatabase(database);
    return DatabaseManager.getCollection(getCollection());
  }
View Full Code Here

            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Initializing XML:DB connection, using driver " + driver);
            }

            try {
                Database db = (Database)Class.forName(driver).newInstance();

                Configuration[] params = drivers[i].getChildren();
                for (int j = 0; j < params.length; j++) {
                    db.setProperty(params[j].getName(), params[j].getValue());
                }

                DatabaseManager.registerDatabase(db);

            } catch (XMLDBException xde) {
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

            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

    AgilaComponent.instance = this;
    // Default initialization
    super.doInit();
    // Configure Xml database
    String workspaceRoot = this.context.getWorkspaceRoot();
    Database database = (Database) Class.forName("org.apache.xindice.client.xmldb.embed.DatabaseImpl").newInstance();
    database.setProperty("db-home", new File(workspaceRoot, "xindice").getCanonicalPath());
    database.setProperty("managed", "false");
    DatabaseManager.registerDatabase(database);
    // Create agila resources
    LifecycleManager.getLifecycleManager().createResources();
  }
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.