CreateDatabase() public method

Creates new database on currently connected server instance.
public CreateDatabase ( string databaseName, ODatabaseType databaseType, OStorageType storageType ) : bool
databaseName string
databaseType ODatabaseType
storageType OStorageType
return bool
Ejemplo n.º 1
0
        static void Test()
        {
            _connection = new OServer(_hostname, _port, _rootName, _rootPassword);

            if (!_connection.DatabaseExist(_databaseName))
            {
                _connection.CreateDatabase(_databaseName, ODatabaseType.Document, OStorageType.Local);

            }

            try
            {
                using (ODatabase database = new ODatabase(_hostname, _port, _databaseName, ODatabaseType.Document, _username, _password))
                {
                    Console.WriteLine("Session ID: {0}", database.SessionID);
                }
            }
            catch (OException ex)
            {
                //Console.WriteLine("{0}: {1}", ex.Type, ex.Description);
            }
            finally
            {
                // delete test database
                _connection.DeleteDatabase(_databaseName);
                _connection.Close();
            }
        }
Ejemplo n.º 2
0
        public void TestServerDatabaseExist()
        {
            using (OServer connection = new OServer(_hostname, _port, _rootName, _rootPassword))
            {
                connection.CreateDatabase(_databaseName, ODatabaseType.Document, OStorageType.Local);

                Assert.IsTrue(connection.DatabaseExist(_databaseName));

                connection.DeleteDatabase(_databaseName);
            }
        }
Ejemplo n.º 3
0
        public ODatabaseTests()
        {
            _connection = new OServer(_hostname, _port, _rootName, _rootPassword);

            // if database exists, delete it
            if (_connection.DatabaseExist(_databaseName))
            {
                _connection.DeleteDatabase(_databaseName);
            }

            _connection.CreateDatabase(_databaseName, ODatabaseType.Document, OStorageType.Local);
        }
Ejemplo n.º 4
0
        public ODatabasePoolTests()
        {
            _connection = new OServer(_hostname, _port, _rootName, _rootPassword);

            // if database exists, delete it
            if (_connection.DatabaseExist(_databaseName))
            {
                _connection.DeleteDatabase(_databaseName);
            }

            _connection.CreateDatabase(_databaseName, ODatabaseType.Document, OStorageType.Local);

            // create database pool
            EasternClient.CreateDatabasePool(_hostname, _port, _databaseName, ODatabaseType.Document, _username, _password, _poolSize, _poolAlias);
        }