Open the physical database.
@exception DBException On open errors.
161566
public void setupJDBCConnection(String strJdbcDriver) throws DBException
    {
        if (m_JDBCConnection != null)
            return;

        if (firstTime == null)
        	firstTime = new Date();
    	if (m_classDB == null)
    	{
	        synchronized (firstTime)
	        {
	        	if (m_classDB == null)
	        		m_classDB = ClassServiceUtility.getClassService().makeObjectFromClassName(strJdbcDriver);
	        }
    	}
        Utility.getLogger().info("Driver found: " + (m_classDB != null));
        m_JDBCConnection = this.getJDBCConnection();    // Setup the initial connection
    }
244508
public void open() throws SQLException, ClassNotFoundException {
        logger.info("Using database driver: " + jdbcDriver);
        Class.forName(jdbcDriver);
        logger.info("Using database.url: " + jdbcURL);
        // connect login/pass
        con = DriverManager.getConnection(jdbcURL, user, password);
        // Exception will be thrown if something went wrong
        connected = true;
    }
633447
public void commit() throws DBException
    {
        super.commit();   // Will throw an error if something is not set up right.
        try   {
            if (this.getRemoteDatabase() != null)
            {
                synchronized (this.getSyncObject(this.getRemoteDatabase()))
                {
                    this.getRemoteDatabase().commit();
                }
            }
        } catch (RemoteException ex)    {
            Utility.getLogger().warning("Remote commit error: " + ex.getMessage());
            ex.printStackTrace();
        } catch (Exception ex)  {
            throw this.convertError(ex);
        }
    }
1023745
final public function openConnection ()
	{
		$this->connection = mysqli_connect(
			getConstant('DB_HOST', TRUE),
			getConstant('DB_USERNAME', TRUE),
			getConstant('DB_PASSWORD', TRUE),
			getConstant('DB_NAME', TRUE)
		);
		$errorMessage 	= "Database connection failed: ".mysqli_connect_error();
		$errorMessage 	.= " (" .mysqli_connect_errno(). ")";
		if (!$this->connection) die($errorMessage);
	}
1119019
public void open() throws IOException, InterruptedException {
    if (queryConfig != null) {
      ref = executeQueryAndWaitForCompletion();
    }
    // Get table schema.
    schema = getTable(ref).getSchema();
  }
310763
public void openTableQuery() throws DBException
    {
        Record record = null;
        boolean bFirstTime = true;
        for (Enumeration<TableLink> e = m_LinkageList.elements() ; e.hasMoreElements() ;)
        {
            TableLink tableLink = e.nextElement();
            record = tableLink.getLeftRecord();
            if (bFirstTime)
            {
                if (!record.isOpen())
                    record.open();
            }
            record = tableLink.getRightRecord();
             if (!record.isOpen())
                record.open();
            bFirstTime = false;
        }
    }
161430
private void allocateConnection() throws SQLException
   {
      if (m_connection == null)
      {
         m_connection = m_dataSource.getConnection();
         m_allocatedConnection = true;
         queryDatabaseMetaData();
      }
   }
546722
@Override
    public void open() throws Exception {
        EDb edb = EDb.fromFileDesktop(databaseFile);
        spatialDb = edb.getSpatialDb();
        spatialDb.open(databaseFile.getAbsolutePath());
        GeometryColumn geometryColumnsForTable = spatialDb.getGeometryColumnsForTable(LasCellsTable.TABLENAME);
        crs = CrsUtilities.getCrsFromSrid(geometryColumnsForTable.srid);
        isOpen = true;
    }
823120
def open(self, dbname=None):
        '''
        
        '''
        databases = self.list()
        if self.is_closed():
            self.db_path = os.path.join(self.path, dbname or (databases and databases[0] or self.new()))
            if not self._opened:
                self.list_tables()
                self._opened = True
506095
public static void main(String[] args) throws Exception {
        try (RocksDbWrapper db = RocksDbWrapper.openReadWrite("/tmp/rocksdb")) {
            db.put("demo", String.valueOf(System.currentTimeMillis()));
        }

        try (RocksDbWrapper db = RocksDbWrapper.openReadOnly("/tmp/rocksdb")) {
            byte[] data = db.get("demo1");
            System.out.println(new String(data));
            // db.setWriteOptions(RocksDbUtils.buildWriteOptions());
            // db.delete("demo");
        }
    }
439350
public static DatabaseException toDatabaseException(Exception ex)
    {
        if (ex instanceof DatabaseException)
            return (DatabaseException)ex;
        int iErrorCode = DBConstants.ERROR_STRING;
        if (ex instanceof DBException)
            iErrorCode = ((DBException)ex).getErrorCode();
        String strMessage = ex.getMessage();
        if (strMessage != null)
            if (strMessage.startsWith(DBEXCEPTION_TEXT))
        {
            int iNextPos = strMessage.indexOf(' ', DBEXCEPTION_TEXT.length());
            if (iNextPos != -1)
            {
                iErrorCode = Integer.parseInt(strMessage.substring(DBEXCEPTION_TEXT.length(), iNextPos));
                if (iNextPos + 1 < strMessage.length())
                    strMessage = strMessage.substring(iNextPos + 1);
            }
        }
        return new DatabaseException(iErrorCode, strMessage);
    }
762565
protected void connect() throws Exception {
        String username = this.properties.getUsername();
        String password = this.properties.getPassword();

        if (this.properties.isEncryptedPassword() || this.properties.isEncryptedUsername()) {
            String privateKey = getPrivateKey();
            if (this.properties.isEncryptedUsername()) {
                final String decryptedUsername = AESHelper.decrypt(this.properties.getProperty(ENCRYPTED_USERNAME), privateKey);
                if (StringUtils.isEmpty(decryptedUsername)) {
                    throw new DatabaseEngineException("The encrypted username could not be decrypted.");
                }
                username = decryptedUsername;

            }

            if (this.properties.isEncryptedPassword()) {
                final String decryptedPassword = AESHelper.decrypt(this.properties.getProperty(ENCRYPTED_PASSWORD), privateKey);
                if (StringUtils.isEmpty(decryptedPassword)) {
                    throw new DatabaseEngineException("The encrypted password could not be decrypted.");
                }
                password = decryptedPassword;
            }
        }

        final String jdbc = getFinalJdbcConnection(this.properties.getJdbc());

        this.conn = DriverManager.getConnection(
                jdbc,
                username,
                password);

        if (this.properties.isSchemaSet()) {
            setSchema(this.properties.getSchema());
        }

        this.currentSchema = Optional.ofNullable(getSchema())
            .orElseThrow(() -> new DatabaseEngineException("Could not get current schema"));

        setTransactionIsolation();

        logger.debug("Connection successful.");
    }
1301509
protected function opendb() {
    // Only do one open
    
    if($this->db) {
      return $this->db;
    }
    //echo "$this->host, $this->user, $this->password";
    try {
      $db = @new PDO($this->host, $this->user, $this->password);
    } catch(PDOException $e) {
      $this->errno = $e->getCode();
      $this->error = $e->getMessage();
      throw new SqlException(__METHOD__.  " Connection failed: $this->host", $this);
    }

    $this->db = $db; // set this right away so if we get an error below $this->db is valid

    return $db;
  }
885569
public static DB open(String driver, String url, Properties props) {
        return new DB(DB.DEFAULT_NAME).open(driver, url, props);
    }
707963
static SQLiteConnection open(com.couchbase.lite.internal.database.sqlite.SQLiteConnectionPool pool,
                                 com.couchbase.lite.internal.database.sqlite.SQLiteDatabaseConfiguration configuration,
                                 com.couchbase.lite.internal.database.sqlite.SQLiteConnectionListener connectionListener,
                                 int connectionId, boolean primaryConnection) {
        SQLiteConnection connection = new SQLiteConnection(pool, configuration, connectionListener,
                connectionId, primaryConnection);
        try {
            connection.open();
            return connection;
        } catch (com.couchbase.lite.internal.database.sqlite.exception.SQLiteException ex) {
            connection.dispose(false);
            throw ex;
        }
    }
639711
static final ZooRollingSession open(String dbName) {
        if (!ZooHelper.dbExists(dbName)) {
            // create database
            // By default, all database files will be created in %USER_HOME%/zoodb
            ZooHelper.createDb(dbName);
        }
		return new ZooRollingSession(dbName);
	}
687194
public void open() throws DBException
    {
        super.open();
        Iterator<BaseTable> iterator = this.getTables();
        while (iterator.hasNext())
        {
            BaseTable table = iterator.next();
            if ((table != null) && (table != this.getNextTable()))
            {
                table.open();
            }
        }
    }