DatabaseExist() 공개 메소드

Checks if specified database exists on currently connected server instance.
public DatabaseExist ( string databaseName ) : bool
databaseName string
리턴 bool
예제 #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();
            }
        }
예제 #2
0
 public void TestServerDatabaseNotExist()
 {
     using (OServer connection = new OServer(_hostname, _port, _rootName, _rootPassword))
     {
         Assert.IsFalse(connection.DatabaseExist("whateverThisShouldNotExist001x"));
     }
 }
예제 #3
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);
            }
        }
예제 #4
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);
        }
예제 #5
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);
        }