Calls the create database script for the given database.<p>

@param database the name of the database
@param replacer the replacements to perform in the drop script
482934
public void createDatabase(String database, Map<String, String> replacer) {

        m_errorLogging = true;
        executeSql(database, "create_db.sql", replacer, true);
    }
691368
def db_remove(database_name, **kwargs):
    '''
    
    '''
    try:
        if db_exists(database_name, **kwargs) and database_name not in ['master', 'model', 'msdb', 'tempdb']:
            conn = _get_connection(**kwargs)
            conn.autocommit(True)
            cur = conn.cursor()
            cur.execute('ALTER DATABASE {0} SET SINGLE_USER WITH ROLLBACK IMMEDIATE'.format(database_name))
            cur.execute('DROP DATABASE {0}'.format(database_name))
            conn.autocommit(False)
            conn.close()
            return True
        else:
            return False
    except Exception as e:
        return 'Could not find the database: {0}'.format(e)
423828
private void createDatabaseIfNotExist(boolean drop) throws URISyntaxException, IOException, ClientProtocolException
    {
        boolean exist = checkForDBExistence();

        if (exist && drop)
        {
            dropDatabase();
            exist = false;
        }
        if (!exist)
        {
            URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(),
                    CouchDBConstants.URL_SEPARATOR + databaseName.toLowerCase(), null, null);

            HttpPut put = new HttpPut(uri);
            HttpResponse putRes = null;
            try
            {
                // creating database.
                putRes = httpClient.execute(httpHost, put, CouchDBUtils.getContext(httpHost));
            }
            finally
            {
                CouchDBUtils.closeContent(putRes);
            }
        }
    }
542574
private static void createDB(String dbName) {
        // remove database if it exists
        if (ZooHelper.dbExists(dbName)) {
            ZooHelper.removeDb(dbName);
        }

        // create database
        // By default, all database files will be created in %USER_HOME%/zoodb
        ZooHelper.createDb(dbName);
    }
45285
public function onReplace(string $hint, callable $replacer, ?string $eventName = null): void
	{
		$hint = $this->resolveAlias($hint);

		$eventName === null ? ($this->replacers[$hint][] = $replacer) : ($this->replacers[$hint][$eventName] = $replacer);
	}
132904
@Override
	public JobInstance createSubJobInstance(String name, String apptag) {
		Connection conn = null;
		PreparedStatement statement = null;
		ResultSet rs = null;
		JobInstanceImpl jobInstance = null;

		try {
			conn = getConnection();
			statement = conn.prepareStatement("INSERT INTO jobinstancedata (name, apptag) VALUES(?, ?)", new String[] { "JOBINSTANCEID" } );
			statement.setString(1, name);
			statement.setString(2, apptag); 
			statement.executeUpdate();
			rs = statement.getGeneratedKeys();
			if(rs.next()) {
				long jobInstanceID = rs.getLong(1);
				jobInstance = new JobInstanceImpl(jobInstanceID);
				jobInstance.setJobName(name);
			}
		} catch (SQLException e) {
			throw new PersistenceException(e);
		} finally {
			cleanupConnection(conn, rs, statement);
		}
		return jobInstance;
	}
125247
public function drop_database($database) {
		$query = 'DROP DATABASE ' . $this->quote_identifier($database);
		$statement = $this->get_statement($query);

		$statement->execute();
	}
597605
public void init(BaseDatabase database, Record record)
    {
        super.init(database, record);
        
        m_databaseFake = m_database;
        m_database = this.getSharedTable().getDatabase();  // Return the correct database
    }
1238937
public function reset(?string $database, $id = null, bool $pretend = false): void
    {
        if (! \is_null($id)) {
            $this->executeFor($id, function ($entity) use ($database, $pretend) {
                $this->runReset($entity, $database, $pretend);
            });

            return;
        }

        $this->executeForEach(function ($entity) use ($database, $pretend) {
            $this->runReset($entity, $database, $pretend);
        });
    }
367061
@Override
  public void addBatch(String sql) throws SQLException {
    checkClosed();

    if (batchStatements == null) {
      batchStatements = new ArrayList<Query>();
      batchParameters = new ArrayList<ParameterList>();
    }

    // Simple statements should not replace ?, ? with $1, $2
    boolean shouldUseParameterized = false;
    CachedQuery cachedQuery = connection.createQuery(sql, replaceProcessingEnabled, shouldUseParameterized);
    batchStatements.add(cachedQuery.query);
    batchParameters.add(null);
  }
548085
public function clone_database($main_db = null, $clone_db = null)
    {

        if (empty($this->db)) {
            throw new DatabaseException('Clone or Main database not connected');
        }

        if (empty($main_db) || empty($clone_db)) {
            throw new DatabaseException('clone names havent been set');
        }

        $sql    = "SHOW CREATE DATABASE `$main_db`";
        $result = $this->fetch_assoc($this->query($sql));

        $create_sql = str_replace($main_db, $clone_db, $result['Create Database']);

        if (empty($create_sql)) {
            throw new DatabaseException('Create database statement is empty!');
        }

        return $this->query($create_sql);
    }
1245551
protected void dropDatabase(String database)
  {

    log.debug("dropping possible existing database");
    closeAllConnections(database);
    getJdbcTemplate().execute("DROP DATABASE IF EXISTS " + database);

  }
1020661
protected void dropSpatialIndexIfExists(final String catalogName, final String schemaName,
         final String tableName, final Database database, final List<Sql> list) {
      final DropSpatialIndexGeneratorGeoDB generator = new DropSpatialIndexGeneratorGeoDB();
      final DropSpatialIndexStatement statement = new DropSpatialIndexStatement(null, catalogName,
            schemaName, tableName);
      list.addAll(Arrays.asList(generator.generateSqlIfExists(statement, database)));
   }
490536
@Override
    public void dropSchema()
    {
        try
        {
            if (operation != null && ("create-drop").equalsIgnoreCase(operation))
            {
                r.dbDrop(databaseName);
            }
        }
        catch (Exception e)
        {
            logger.error("Error while dropping schema", e);
            throw new SchemaGenerationException(e, "RethinkDB");
        }
    }
397271
@GET
    @Path("{dbName}/scripts/{revision}")
    public ScriptInfo script(@PathParam("dbName") String dbName, @PathParam("revision") String revision) {
        Migration migration = locator.getService(Migration.class, dbName);
        if (migration == null)
            throw new NotFoundException();
        return migration.getScript(revision);
    }
1100796
@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		ApptentiveLog.d(DATABASE, "Upgrade database from %d to %d", oldVersion, newVersion);
		try {
			DatabaseMigrator migrator = createDatabaseMigrator(oldVersion, newVersion);
			if (migrator != null) {
				migrator.onUpgrade(db, oldVersion, newVersion);
			}
		} catch (Exception e) {
			ApptentiveLog.e(DATABASE, e, "Exception while trying to migrate database from %d to %d", oldVersion, newVersion);
			logException(e);

			// if migration failed - create new table
			db.execSQL(SQL_DELETE_PAYLOAD_TABLE);
			onCreate(db);
		}
	}
997967
public void init(BaseDatabase database, Record record)
    {
        super.init(database, record);

        // Call super to set the table property (without calling remote).
        super.setProperty(DBParams.SUPRESSREMOTEDBMESSAGES, DBConstants.TRUE);
    }