Init the database, if required.
966881
def open(self, new=False):
        '''
        
        '''
        self._db.new() if new else self._db.open()  # pylint: disable=W0106
        self._run_init_queries()
798731
def init_db(self):
        

        # database file
        db_path = self.get_data_file("data.sqlite")

        # comect and create cursor
        self.db = sqlite3.connect(db_path)
        self.cursor = self.db.cursor()

        # prep tables
        self.db_exec('''
            CREATE TABLE IF NOT EXISTS shortcuts (
                id INTEGER PRIMARY KEY AUTOINCREMENT,
                name TEXT NOT NULL,
                path TEXT NOT NULL,
                command TEXT NOT NULL
            )
            ''')
926317
void initialize()
    {
        if (m_backend == BackendTarget.HSQLDB_BACKEND) {
            m_non_voltdb_backend = HsqlBackend.initializeHSQLBackend(m_siteId,
                                                       m_context);
        }
        else if (m_backend == BackendTarget.POSTGRESQL_BACKEND) {
            m_non_voltdb_backend = PostgreSQLBackend.initializePostgreSQLBackend(m_context);
        }
        else if (m_backend == BackendTarget.POSTGIS_BACKEND) {
            m_non_voltdb_backend = PostGISBackend.initializePostGISBackend(m_context);
        }
        else {
            m_non_voltdb_backend = null;
        }
    }
161654
public function init()
    {

        // initialize the prepared statements
        $this->bundleOptionValueStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::BUNDLE_OPTION_VALUE));
    }
1267651
public function init()
    {

        // initialize the prepared statements
        $this->customerDatetimesStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_DATETIMES));
    }
658196
public function init()
    {

        // initialize the prepared statements
        $this->productSuperAttributeStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_SUPER_ATTRIBUTE));
    }
1331429
private void init() {
    host = DEFAULT_HOST;
    port = DEFAULT_PORT;
    database = DEFAULT_DATABASE;
    user = DEFAULT_USER;
    password = DEFAULT_PASSWORD;
    cachePreparedStatements = DEFAULT_CACHE_PREPARED_STATEMENTS;
    pipeliningLimit = DEFAULT_PIPELINING_LIMIT;
    sslMode = DEFAULT_SSLMODE;
  }
1260525
def initialize(self):
        """"""
        self.Base.metadata.create_all(self.session.bind)
        logger.debug("initialized sqlalchemy orm tables")
647264
@Override
    public void initialize() {
        String adminUsername = "admin";
        String adminPassword = "123456";

        User param = new User();
        param.setUserName(adminUsername);
        User admin = baseDao.getUnique(User.class, param);
        if (admin != null) {
            LoggerHelper.info("database has been initialized.");
            return;
        }
        LoggerHelper.info("begin init database.");
        admin = new User();
        admin.setUserName(adminUsername);
        admin.setUserPassword(HashHelper.getHashedPassword(adminPassword, adminUsername));
        admin.setPasswordSalt(adminUsername);

        Role role = new Role();
        role.setRoleName("ROLE_ADMIN");
        role.setRoleDescription("Administrator");
        baseDao.save(role);

        admin.setRoleList(Arrays.asList(role));
        baseDao.save(admin);

        LoggerHelper.info("init database successfully.");
    }
735202
public function init()
    {

        // initialize the prepared statements
        $this->customerIntsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_INTS));
    }
676560
public function init()
    {

        // initialize the prepared statements
        $this->productStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT));
        $this->productsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCTS));
    }
130914
def initdb(self):
        '''
        '''

        self.database = EXPFACTORY_DATABASE
        bot.info("DATABASE: %s" %self.database)

        # Supported database options
        valid = ('sqlite', 'postgres', 'mysql', 'filesystem')
        if not self.database.startswith(valid):
            bot.warning('%s is not yet a supported type, saving to filesystem.' % self.database)
            self.database = 'filesystem'

        # Add functions specific to database type
        self.init_db() # uses url in self.database

        bot.log("Data base: %s" % self.database)
160467
public function init()
    {
        parent::init();
        $this->db = Instance::ensure($this->module->db, Connection::className());
        if ($this->db->driverName === 'mysql') {
            $this->tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }
    }
625290
function databaseInitialize() {
  // on the first load of (non-existent database), we will have no collections so we can 
  //   detect the absence of our collections and add (and configure) them now.
  var entries = db.getCollection("entries");
  if (entries === null) {
    entries = db.addCollection("entries");
  }

  // kick off any program logic or start listening to external events
  runProgramLogic();
}
886129
public void init(BaseDatabase database, Record record)
    {
        super.init(database, record);
        m_iRow = -1;        // resultSet row 0 = First row.
        m_iEOFRow = Integer.MAX_VALUE;  // Last valid row.
        m_iLastOrder = -1;
    }
1213952
def init_db(self, app, entry_point_group='invenio_db.models', **kwargs):
        """"""
        # Setup SQLAlchemy
        app.config.setdefault(
            'SQLALCHEMY_DATABASE_URI',
            'sqlite:///' + os.path.join(app.instance_path, app.name + '.db')
        )
        app.config.setdefault('SQLALCHEMY_ECHO', False)

        # 
        database = kwargs.get('db', db)
        database.init_app(app)

        # Initialize versioning support.
        self.init_versioning(app, database, kwargs.get('versioning_manager'))

        # Initialize model bases
        if entry_point_group:
            for base_entry in pkg_resources.iter_entry_points(
                    entry_point_group):
                base_entry.load()

        # All models should be loaded by now.
        sa.orm.configure_mappers()
        # Ensure that versioning classes have been built.
        if app.config['DB_VERSIONING']:
            manager = self.versioning_manager
            if manager.pending_classes:
                if not versioning_models_registered(manager, database.Model):
                    manager.builder.configure_versioned_classes()
            elif 'transaction' not in database.metadata.tables:
                manager.declarative_base = database.Model
                manager.create_transaction_model()
                manager.plugins.after_build_tx_class(manager)
1024036
public function initDatabase()
    {
        $this->call('migrate');

        if (Administrator::count() == 0) {
            $this->call('db:seed', ['--class' => \ShaoZeMing\Merchant\Auth\Database\AdminTablesSeeder::class]);
        }
    }