Exemplo n.º 1
0
 public DatabaseInformation(Database db, ArrayList tables, Access access)
 {
     dDatabase = db;
     tTable = tables;
     aAccess = access;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Database class constructor.
        /// </summary>
        /// <param name="name">The database name to open or create.</param>
        public Database(string name)
        {
            if (TracingHelper.TraceEnabled)
            {
                TracingHelper.Write();
            }

            _name = name;
            _table = new ArrayList();
            _access = new Access();
            _channel = new Hashtable();
            _alias = new Hashtable();
            _referentialIntegrity = true;

            Library.Register(_alias);

            _databaseInfo = new DatabaseInformation(this, _table, _access);

            bool newdatabase = false;
            Channel sys = new Channel(this, new User(null, null, true, null),
                true, false, 0);

            RegisterChannel(sys);

            if (name.Equals("."))
            {
                newdatabase = true;
            }
            else
            {
                _log = new Log(this, sys, name);
                newdatabase = _log.Open();
            }

            if (newdatabase)
            {
                Execute("CREATE USER SA PASSWORD \"\" ADMIN", sys);
            }

            //_access.grant("PUBLIC", "CLASS \"SharpHSQL.Library\"", Access.ALL);
        }