Checks if a database exists in the remote server.

@return true if exists, otherwise false
@throws IOException
420015
public synchronized boolean existsDatabase() throws IOException {
    storage.checkConnection();

    try {
      final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_DB_EXIST);
      try {
        network.writeString(storage.getName());
      } finally {
        storage.endRequest(network);
      }

      try {
        storage.beginResponse(network);
        return network.readByte() == 1;
      } finally {
        storage.endResponse(network);
      }

    } catch (Exception e) {
      OLogManager.instance().exception("Error on checking existence of the remote storage: " + storage.getName(), e,
          OStorageException.class);
      storage.close(true);
    }
    return false;
  }
133209
@Override
	public boolean isConnected() {
		try {
			ResultSet rs = executeSelectSQL("SELECT 1", null);
			if (rs.next()) {
				return true;
			}
			return false;
		} catch (DatabaseException e) {
			e.printStackTrace();
			return false;
		} catch (SQLException e) {
			e.printStackTrace();
			return false;
		}

	}
947742
public boolean create(String strDatabaseName) throws DBException
    {
        try {
            String strDBName = this.getProperty(SQLParams.INTERNAL_DB_NAME);
            int iDatabaseType = DBConstants.SYSTEM_DATABASE;
            DatabaseOwner env = this.getDatabaseOwner();
            JdbcDatabase db = (JdbcDatabase)env.getDatabase(strDBName, iDatabaseType, null);    // Do NOT pass properties when opening system database
            Statement queryStatement = db.getJDBCConnection().createStatement();

            String strSQL = "create database " + strDatabaseName + ";";
            queryStatement.execute(strSQL);
            queryStatement.close();
            db.free();

            String oldValue = this.getProperty(DBConstants.CREATE_DB_IF_NOT_FOUND);
            this.setProperty(DBConstants.CREATE_DB_IF_NOT_FOUND, DBConstants.FALSE);
            
            this.close();   // Since I don't know what kind of connection this is.
            this.setupDBConnection();

            this.setProperty(DBConstants.CREATE_DB_IF_NOT_FOUND, oldValue);
            
            if (this.getProperty(DBConstants.LOAD_INITIAL_DATA) != null)
            	if ((this.getDatabaseType() & (DBConstants.SHARED_DATA | DBConstants.USER_DATA)) == DBConstants.SHARED_DATA)	// Yes, only shared data can have DatabaseInfo
            {
                DatabaseInfo recDatabaseInfo = new DatabaseInfo();
                try {
                	recDatabaseInfo.setDatabaseName(this.getDatabaseName(false));
                	recDatabaseInfo.setTable(this.doMakeTable(recDatabaseInfo));    // This makes a jdbc table
                	recDatabaseInfo.init(null); // This should create the table if an archive exists
                } catch (Exception ex) {
                	// Ignore
                } finally {
                	recDatabaseInfo.free();
                }
            }
            return true;    // Success
        } catch (SQLException ex) {
            ex.printStackTrace();
        }

        return super.create(strDatabaseName);   // Error, not found
    }
1255129
public boolean exists(Path filename) throws IOException {
    try {
      return getMfs().listFiles(filename, true).hasNext();
    } catch (FileNotFoundException e) {
      return false;
    }
  }
71444
public boolean exists(long featureId, String database, String table) {
        boolean exists = false;
        Map<String, Map<Long, FeatureShape>> tables = databases.get(database);
        if (tables != null) {

            Map<Long, FeatureShape> featureIds = tables.get(table);
            if (featureIds != null) {
                FeatureShape shapes = featureIds.get(featureId);
                exists = shapes != null && shapes.hasShapes();
            }
        }
        return exists;
    }
102274
@Override
    public boolean databaseExists(String directory) {
        if (new File(directory, kDBFilename).exists())
            return true;
        // If "db.forest" doesn't exist (auto-compaction will add numeric suffixes), check for meta:
        return new File(directory, kDBFilename + ".meta").exists();
    }
1084340
def does_table_exist(self, connection):
        

        if '.' in self.table:
            query = ("select 1 as table_exists "
                     "from information_schema.tables "
                     "where table_schema = lower(%s) and table_name = lower(%s) limit 1")
        else:
            query = ("select 1 as table_exists "
                     "from pg_table_def "
                     "where tablename = lower(%s) limit 1")
        cursor = connection.cursor()
        try:
            cursor.execute(query, tuple(self.table.split('.')))
            result = cursor.fetchone()
            return bool(result)
        finally:
            cursor.close()
547426
public boolean exists() {
		try {
			if(!isBinary)return getJedisCommands(groupName).exists(key);
			if(isCluster(groupName)){
				return getBinaryJedisClusterCommands(groupName).exists(keyBytes);
			}
			return getBinaryJedisCommands(groupName).exists(keyBytes);
		} finally {
			getJedisProvider(groupName).release();
		}
		
	}
817060
def exists_table(self, name, database=None):
        
        return bool(self.list_tables(like=name, database=database))
1157012
@Override
	public boolean existSql(final String fileName) {
		return Thread.currentThread().getContextClassLoader().getResource(getFilePath(fileName)) != null;
	}
666107
public boolean keyspaceExists(DBConn dbConn, String keyspace) {
        try {
            dbConn.getClientSession().describe_keyspace(keyspace);
            return true;
        } catch (Exception e) {
            return false;   // Notfound
        }
    }
567263
private boolean checkForDBExistence() throws ClientProtocolException, IOException, URISyntaxException
    {
        URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(),
                CouchDBConstants.URL_SEPARATOR + databaseName.toLowerCase(), null, null);

        HttpGet get = new HttpGet(uri);
        HttpResponse getRes = null;
        try
        {
            // creating database.
            getRes = httpClient.execute(httpHost, get, CouchDBUtils.getContext(httpHost));
            if (getRes.getStatusLine().getStatusCode() == HttpStatus.SC_OK)
            {
                return true;
            }
            return false;
        }
        finally
        {
            CouchDBUtils.closeContent(getRes);
        }
    }
800619
def exists(self):
        

        if self.driver == 'sqlite' and not os.path.exists(self.path):
            return False

        # init engine
        self.engine

        try:
            # Since we are using the connection, rather than the session, need to
            # explicitly set the search path.

            from sqlalchemy.engine.reflection import Inspector

            inspector = Inspector.from_engine(self.engine)

            if 'config' in inspector.get_table_names(schema=self._schema):
                return True
            else:
                return False
        finally:
            self.close_connection()
791536
public boolean exists() throws APIException {
        HttpResponse response = client.head(getUrl());
        int status = response.getStatusLine().getStatusCode();
        if(status != 200 && status != 404) {
            throw APIException.fromHttpResponse(response);
        }
        return (200 == status);
    }
696838
public boolean exitsMongoDbDataBase(String dataBaseName) {
        List<String> dataBaseList = mongoClient.getDatabaseNames();
        return dataBaseList.contains(dataBaseName);
    }
384961
def exists(self):
        
        cur = self.connection.query("SHOW DATABASES LIKE '{database}'".format(database=self.database))
        return cur.rowcount > 0
485918
@Override
    public boolean exists(String id) throws Exception {
        // try the object store first
        Session s = doGet(id);
        if (s != null) {
            try (Lock ignored = s.lock()) {
                // wait for the lock and check the validity of the session
                return s.isValid();
            }
        }
        // not there, so find out if session data exists for it
        return (sessionDataStore != null && sessionDataStore.exists(id));
    }