Package org.apache.derby.iapi.db

Examples of org.apache.derby.iapi.db.Database


      // clear these values as some modules hang onto
      // the properties set corresponding to service.properties
      // and they shouldn't be interested in these JDBC attributes.
      info.clear();

      Database database = (Database) Monitor.findService(Property.DATABASE_MODULE, dbname);
      tr.setDatabase(database);

    } catch (StandardException mse) {

      Throwable ne = mse.getCause();
View Full Code Here


      // if we are shutting down don't attempt to boot or create the database
      boolean shutdown = Boolean.valueOf(info.getProperty(Attribute.SHUTDOWN_ATTR)).booleanValue();

      // see if database is already booted
      Database database = (Database) Monitor.findService(Property.DATABASE_MODULE, tr.getDBName());

      // See if user wants to create a new database.
      boolean  createBoot = createBoot(info)

      // DERBY-2264: keeps track of whether we do a plain boot before an
      // (re)encryption or hard upgrade boot to (possibly) authenticate
      // first. We can not authenticate before we have booted, so in
      // order to enforce data base owner powers over encryption or
      // upgrade, we need a plain boot, then authenticate, then, if all
      // is well, boot with (re)encryption or upgrade.  Encryption at
      // create time is not checked.
      boolean isTwoPhaseEncryptionBoot = (!createBoot &&
                        isEncryptionBoot(info));
      boolean isTwoPhaseUpgradeBoot = (!createBoot &&
                       isHardUpgradeBoot(info));
      boolean isStartSlaveBoot = isStartReplicationSlaveBoot(info);
            // Set to true if startSlave command is attempted on an
            // already booted database. Will raise an exception when
            // credentials have been verified
            boolean slaveDBAlreadyBooted = false;

            boolean isFailoverMasterBoot = false;
            boolean isFailoverSlaveBoot = false;

            // check that a replication operation is not combined with
            // other operations
            String replicationOp = getReplicationOperation(info);
            if (replicationOp!= null) {
                if (createBoot ||
                    shutdown ||
                    isTwoPhaseEncryptionBoot ||
                    isTwoPhaseUpgradeBoot) {
                    throw StandardException.
                        newException(SQLState.
                                     REPLICATION_CONFLICTING_ATTRIBUTES,
                                     replicationOp);
                }
            }

            if (isReplicationFailover(info)) {
                // Check that the database has been booted - otherwise throw
                // exception.
                checkDatabaseBooted(database,
                                    Attribute.REPLICATION_FAILOVER,
                                    tr.getDBName());
                // The failover command is the same for master and slave
                // databases. If the db is not in slave replication mode, we
                // assume that it is in master mode. If not in any replication
                // mode, the connection attempt will fail with an exception
                if (database.isInSlaveMode()) {
                    isFailoverSlaveBoot = true;
                } else {
                    isFailoverMasterBoot = true;
                }
            }
View Full Code Here

     *
     * @return 0 if there is no database, the engine type otherwise. @see org.apache.derby.iapi.reference.EngineType
     */
    public int getEngineType()
    {
        Database db = getDatabase();

        if( null == db)
            return 0;
        return db.getEngineType();
    }
View Full Code Here

      // clear these values as some modules hang onto
      // the properties set corresponding to service.properties
      // and they shouldn't be interested in these JDBC attributes.
      info.clear();

      Database database = (Database) Monitor.findService(Property.DATABASE_MODULE, dbname);
      tr.setDatabase(database);

    } catch (StandardException mse) {

      Throwable ne = mse.getCause();
View Full Code Here

      // if we are shutting down don't attempt to boot or create the database
      boolean shutdown = Boolean.valueOf(info.getProperty(Attribute.SHUTDOWN_ATTR)).booleanValue();

      // see if database is already booted
      Database database = (Database) Monitor.findService(Property.DATABASE_MODULE, tr.getDBName());

      // See if user wants to create a new database.
      boolean  createBoot = createBoot(info)

      // DERBY-2264: keeps track of whether we do a plain boot before an
View Full Code Here

     *
     * @return 0 if there is no database, the engine type otherwise. @see org.apache.derby.iapi.reference.EngineType
     */
    public int getEngineType()
    {
        Database db = getDatabase();

        if( null == db)
            return 0;
        return db.getEngineType();
    }
View Full Code Here

      // clear these values as some modules hang onto
      // the properties set corresponding to service.properties
      // and they shouldn't be interested in these JDBC attributes.
      info.clear();

      Database database = (Database) Monitor.findService(Property.DATABASE_MODULE, dbname);
      tr.setDatabase(database);

    } catch (StandardException mse) {

      Throwable ne = mse.getCause();
View Full Code Here

      // if we are shutting down don't attempt to boot or create the database
      boolean shutdown = Boolean.valueOf(info.getProperty(Attribute.SHUTDOWN_ATTR)).booleanValue();

      // see if database is already booted
      Database database = (Database) Monitor.findService(Property.DATABASE_MODULE, tr.getDBName());

      // See if user wants to create a new database.
      boolean  createBoot = createBoot(info)

      // DERBY-2264: keeps track of whether we do a plain boot before an
      // (re)encryption or hard upgrade boot to (possibly) authenticate
      // first. We can not authenticate before we have booted, so in
      // order to enforce data base owner powers over encryption or
      // upgrade, we need a plain boot, then authenticate, then, if all
      // is well, boot with (re)encryption or upgrade.  Encryption at
      // create time is not checked.
      boolean isTwoPhaseEncryptionBoot = (!createBoot &&
                        isEncryptionBoot(info));
      boolean isTwoPhaseUpgradeBoot = (!createBoot &&
                       isHardUpgradeBoot(info));
      boolean isStartSlaveBoot = isStartReplicationSlaveBoot(info);
            // Set to true if startSlave command is attempted on an
            // already booted database. Will raise an exception when
            // credentials have been verified
            boolean slaveDBAlreadyBooted = false;

            boolean isFailoverMasterBoot = false;
            boolean isFailoverSlaveBoot = false;

            // check that a replication operation is not combined with
            // other operations
            String replicationOp = getReplicationOperation(info);
            if (replicationOp!= null) {
                if (createBoot ||
                    shutdown ||
                    isTwoPhaseEncryptionBoot ||
                    isTwoPhaseUpgradeBoot) {
                    throw StandardException.
                        newException(SQLState.
                                     REPLICATION_CONFLICTING_ATTRIBUTES,
                                     replicationOp);
                }
            }

            if (isReplicationFailover(info)) {
                // Check that the database has been booted - otherwise throw
                // exception.
                checkDatabaseBooted(database,
                                    Attribute.REPLICATION_FAILOVER,
                                    tr.getDBName());
                // The failover command is the same for master and slave
                // databases. If the db is not in slave replication mode, we
                // assume that it is in master mode. If not in any replication
                // mode, the connection attempt will fail with an exception
                if (database.isInSlaveMode()) {
                    isFailoverSlaveBoot = true;
                } else {
                    isFailoverMasterBoot = true;
                }
            }
View Full Code Here

     *
     * @return 0 if there is no database, the engine type otherwise. @see org.apache.derby.iapi.reference.EngineType
     */
    public int getEngineType()
    {
        Database db = getDatabase();

        if( null == db)
            return 0;
        return db.getEngineType();
    }
View Full Code Here

      // clear these values as some modules hang onto
      // the properties set corresponding to service.properties
      // and they shouldn't be interested in these JDBC attributes.
      info.clear();

      Database database = (Database) Monitor.findService(Property.DATABASE_MODULE, dbname);
      tr.setDatabase(database);

    } catch (StandardException mse) {

      Throwable ne = mse.getCause();
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.db.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.