Azavea.Open.DAO.Firebird.FirebirdDescriptor.FirebirdDescriptor C# (CSharp) Method

FirebirdDescriptor() public method

This constructor reads all the appropriate values from our standard config file in the normal format.
public FirebirdDescriptor ( Config config, string component, ConnectionInfoDecryptionDelegate decryptionDelegate ) : System
config Azavea.Open.Common.Config Config to get params from.
component string Section of the config XML to look in for db params.
decryptionDelegate ConnectionInfoDecryptionDelegate Delegate to call to decrypt password fields. /// May be null if passwords are in plain text.
return System
        public FirebirdDescriptor(Config config, string component,
            ConnectionInfoDecryptionDelegate decryptionDelegate)
        {
            FbConnectionStringBuilder builder = new FbConnectionStringBuilder();
            Server = config.GetParameter(component, "Server", null);
            if (StringHelper.IsNonBlank(Server))
            {
                builder.DataSource = Server;
            }
            else
            {
                builder.ServerType = FbServerType.Embedded;
                // For the embedded server, we want to disable pooling so we don't wind up locking
                // the file indefinitely.
                builder.Pooling = false;
                _usePooling = false;
            }
            builder.Database = Database = config.GetParameterWithSubstitution(component, "Database", true);
            builder.UserID = User = config.GetParameter(component, "User", null);

            // First make it without a password.
            _cleanConnStr = builder.ToString();
            // Now with the password for the real one.
            Password = GetDecryptedConfigParameter(config, component, "Password", decryptionDelegate);
            builder.Password = Password;
            _connectionStr = builder.ToString();
        }

Same methods

FirebirdDescriptor::FirebirdDescriptor ( string databasePath ) : System
FirebirdDescriptor::FirebirdDescriptor ( string server, string database, string user, string password ) : System