Package org.apache.derby.iapi.services.io

Examples of org.apache.derby.iapi.services.io.FormatableProperties


    String dbname = InternalDriver.getDatabaseName(url, info);

    // convert the ;name=value attributes in the URL into
    // properties.
    FormatableProperties finfo = getAttributes(url, info);
    info = null; // ensure we don't use this reference directly again.
    boolean encryptDB = Boolean.valueOf(finfo.getProperty(Attribute.DATA_ENCRYPTION)).booleanValue();   
    String encryptpassword = finfo.getProperty(Attribute.BOOT_PASSWORD);

    if (dbname.length() == 0 || (encryptDB && encryptpassword == null)) {

      // with no database name we can have shutdown or a database name

      // In future, if any new attribute info needs to be included in this
      // method, it just has to be added to either string or boolean or secret array
      // depending on whether it accepts string or boolean or secret(ie passwords) value.

      String[][] connStringAttributes = {
        {Attribute.DBNAME_ATTR, MessageId.CONN_DATABASE_IDENTITY},
        {Attribute.CRYPTO_PROVIDER, MessageId.CONN_CRYPTO_PROVIDER},
        {Attribute.CRYPTO_ALGORITHM, MessageId.CONN_CRYPTO_ALGORITHM},
        {Attribute.CRYPTO_KEY_LENGTH, MessageId.CONN_CRYPTO_KEY_LENGTH},
        {Attribute.CRYPTO_EXTERNAL_KEY, MessageId.CONN_CRYPTO_EXTERNAL_KEY},
        {Attribute.TERRITORY, MessageId.CONN_LOCALE},
        {Attribute.COLLATION, MessageId.CONN_COLLATION},
        {Attribute.USERNAME_ATTR, MessageId.CONN_USERNAME_ATTR},
        {Attribute.LOG_DEVICE, MessageId.CONN_LOG_DEVICE},
        {Attribute.ROLL_FORWARD_RECOVERY_FROM, MessageId.CONN_ROLL_FORWARD_RECOVERY_FROM},
        {Attribute.CREATE_FROM, MessageId.CONN_CREATE_FROM},
        {Attribute.RESTORE_FROM, MessageId.CONN_RESTORE_FROM},
      };

      String[][] connBooleanAttributes = {
        {Attribute.SHUTDOWN_ATTR, MessageId.CONN_SHUT_DOWN_CLOUDSCAPE},
                {Attribute.DEREGISTER_ATTR, MessageId.CONN_DEREGISTER_AUTOLOADEDDRIVER},
        {Attribute.CREATE_ATTR, MessageId.CONN_CREATE_DATABASE},
        {Attribute.DATA_ENCRYPTION, MessageId.CONN_DATA_ENCRYPTION},
        {Attribute.UPGRADE_ATTR, MessageId.CONN_UPGRADE_DATABASE},
        };

      String[][] connStringSecretAttributes = {
        {Attribute.BOOT_PASSWORD, MessageId.CONN_BOOT_PASSWORD},
        {Attribute.PASSWORD_ATTR, MessageId.CONN_PASSWORD_ATTR},
        };

     
      DriverPropertyInfo[] optionsNoDB = new   DriverPropertyInfo[connStringAttributes.length+
                                    connBooleanAttributes.length+
                                                                connStringSecretAttributes.length];
     
      int attrIndex = 0;
      for( int i = 0; i < connStringAttributes.length; i++, attrIndex++ )
      {
        optionsNoDB[attrIndex] = new DriverPropertyInfo(connStringAttributes[i][0],
                    finfo.getProperty(connStringAttributes[i][0]));
        optionsNoDB[attrIndex].description = MessageService.getTextMessage(connStringAttributes[i][1]);
      }

      optionsNoDB[0].choices = Monitor.getMonitor().getServiceList(Property.DATABASE_MODULE);
      // since database name is not stored in FormatableProperties, we
      // assign here explicitly
      optionsNoDB[0].value = dbname;

      for( int i = 0; i < connStringSecretAttributes.length; i++, attrIndex++ )
      {
        optionsNoDB[attrIndex] = new DriverPropertyInfo(connStringSecretAttributes[i][0],
                    (finfo.getProperty(connStringSecretAttributes[i][0]) == null? "" : "****"));
        optionsNoDB[attrIndex].description = MessageService.getTextMessage(connStringSecretAttributes[i][1]);
      }

      for( int i = 0; i < connBooleanAttributes.length; i++, attrIndex++ )
      {
        optionsNoDB[attrIndex] = new DriverPropertyInfo(connBooleanAttributes[i][0],
                   Boolean.valueOf(finfo == null? "" : finfo.getProperty(connBooleanAttributes[i][0])).toString());
        optionsNoDB[attrIndex].description = MessageService.getTextMessage(connBooleanAttributes[i][1]);
        optionsNoDB[attrIndex].choices = BOOLEAN_CHOICES;       
      }

      return optionsNoDB;
View Full Code Here


                                                                getContextManager());}
    throw new Error("Missing return statement in function");
  }

  final public Properties propertyList() throws ParseException, StandardException {
        Properties properties = new FormatableProperties();
    jj_consume_token(PROPERTIES);
    property(properties);
    label_33:
    while (true) {
      if (anotherPropertyFollows()) {
View Full Code Here

                                                    null,
                                                    getContextManager());

    //we would like to use references index & table scan instead of
    //what optimizer says for the dependent table scan.
    Properties targetProperties = new FormatableProperties();
    targetProperties.put("index", "null");
    ((FromBaseTable) fromTable).setTableProperties(targetProperties);

        fromList.addFromTable(fromTable);
        resultSet = (SelectNode) nodeFactory.getNode(
                                                     C_NodeTypes.SELECT_NODE,
View Full Code Here

                                                    getContextManager());


    //we would like to use references index & table scan instead of
    //what optimizer says for the dependent table scan.
    Properties targetProperties = new FormatableProperties();
    targetProperties.put("index", "null");
    ((FromBaseTable) fromTable).setTableProperties(targetProperties);

        fromList.addFromTable(fromTable);

    resultSet = (SelectNode) nodeFactory.getNode(
View Full Code Here

    this.rowsInput = rowsInput;
    this.rowsReturned = rowsReturned;
    this.eliminateDuplicates = eliminateDuplicates;
    this.inSortedOrder = inSortedOrder;
    this.childResultSetStatistics = childResultSetStatistics;
    this.sortProperties = new FormatableProperties();
    for (Enumeration e = sortProperties.keys(); e.hasMoreElements(); )
    {
      String key = (String)e.nextElement();
      this.sortProperties.put(key, sortProperties.get(key));
    }
View Full Code Here

    this.isConstraint = isConstraint;
    this.hashtableSize = hashtableSize;
    this.hashKeyColumns = hashKeyColumns;
    this.scanQualifiers = scanQualifiers;
    this.nextQualifiers = nextQualifiers;
    this.scanProperties = new FormatableProperties();
    if (scanProperties != null)
    {
      for (Enumeration e = scanProperties.keys(); e.hasMoreElements(); )
      {
        String key = (String)e.nextElement();
View Full Code Here

      optimizerEstimatedCost
      );
    this.hashtableSize = hashtableSize;
    this.hashKeyColumns = hashKeyColumns;
    this.nextQualifiers = nextQualifiers;
    this.scanProperties = new FormatableProperties();
    if (scanProperties != null)
    {
      for (Enumeration e = scanProperties.keys(); e.hasMoreElements(); )
      {
        String key = (String)e.nextElement();
View Full Code Here

      );
    this.tableName = tableName;
    this.indexName = indexName;
    this.isConstraint = isConstraint;
    this.qualifiers = qualifiers;
    this.scanProperties = new FormatableProperties();
    for (Enumeration e = scanProperties.keys(); e.hasMoreElements(); )
    {
      String key = (String)e.nextElement();
      this.scanProperties.put(key, scanProperties.get(key));
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.services.io.FormatableProperties

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.