Same as {@link DB#withDb(Supplier)}, but with db name {@link DB#DEFAULT_NAME}.
972482
public <T> T withDb(Supplier<T> supplier) {
        return new DB(DB.DEFAULT_NAME).withDb(supplier);
    }
1068479
protected JdbcQueueFactory<T, ID, DATA> setDefaultJdbcHelper(IJdbcHelper jdbcHelper,
            boolean setMyOwnJdbcHelper) {
        if (myOwnJdbcHelper && this.defaultJdbcHelper != null
                && this.defaultJdbcHelper instanceof AbstractJdbcHelper) {
            ((AbstractJdbcHelper) this.defaultJdbcHelper).destroy();
        }
        this.defaultJdbcHelper = jdbcHelper;
        this.myOwnJdbcHelper = setMyOwnJdbcHelper;
        return this;
    }
1341666
public static @NotNull Database forJndiDataSource(@NotNull String jndiName) {
        return forDataSource(JndiUtils.lookupJndiDataSource(jndiName));
    }
353759
def db(ctx):
    """"""

    from hfos import database
    database.initialize(ctx.obj['dbhost'], ctx.obj['dbname'])
    ctx.obj['db'] = database
334342
public boolean setupDataSourceConnection(String strDataSource) throws DBException
    {
        if (m_JDBCConnection != null)
            return true;
        if ((DBConstants.TRUE.equalsIgnoreCase(this.getProperty(DBParams.SERVLET)))
                || ((this.getDatabaseOwner() != null) && (DBConstants.TRUE.equalsIgnoreCase(this.getDatabaseOwner().getEnvironment().getProperty(DBParams.SERVLET)))))
        {   // Datasource connections are only for servlets (NOTE: Letting this code run otherwise messes stuff up)
            try {
                if (m_initialContext == null)
                    m_initialContext = new InitialContext();
                String strDatabaseName = this.getDatabaseName(true);
                strDataSource = Utility.replace(strDataSource, "${dbname}", strDatabaseName);
                DataSource ds = (DataSource)m_initialContext.lookup(strDataSource);
                if (ds == null)
                    return false;   // Failure
                m_JDBCConnection = ds.getConnection();
            } catch (NamingException e) {
                return false;   // Failure
            } catch (SQLException e) {
                return false;   // Failure
            } catch (NoClassDefFoundError e) {
                return false;   // Failure
            } catch (Exception e) {
                return false;   // Failure
            }
            return true;    // Success!
        }
        else
            return false;   // Not supported
    }
1124619
public String getDatabaseName(boolean bPhysicalName)
    {
        String strDbName = m_strDbName;
        if (bPhysicalName)
        {
            if ((this.getDatabaseType() & DBConstants.SYSTEM_DATABASE) != DBConstants.SYSTEM_DATABASE)
            {
                if ((this.getProperty(strDbName + DBSHARED_PARAM_SUFFIX) != null)
                    && (!m_strDbName.equalsIgnoreCase(this.getProperty(SQLParams.INTERNAL_DB_NAME)))
                    && ((this.getDatabaseType() & DBConstants.TABLE_DATA_TYPE_MASK) == DBConstants.SHARED_DATA))
                        strDbName = this.getProperty(strDbName + DBSHARED_PARAM_SUFFIX);	// Special processing - db name supplied
                else if ((this.getProperty(strDbName + DBUSER_PARAM_SUFFIX) != null)
                    && (!m_strDbName.equalsIgnoreCase(this.getProperty(SQLParams.INTERNAL_DB_NAME)))
                    && ((this.getDatabaseType() & DBConstants.TABLE_DATA_TYPE_MASK) == DBConstants.USER_DATA))
                        strDbName = this.getProperty(strDbName + DBUSER_PARAM_SUFFIX);	// Special processing - db name supplied
                else
                {
	                if (this.getProperty(DBConstants.DB_USER_PREFIX) != null)
	                    if (!m_strDbName.equalsIgnoreCase(this.getProperty(SQLParams.INTERNAL_DB_NAME)))
	                        if ((this.getDatabaseType() & DBConstants.TABLE_DATA_TYPE_MASK) == DBConstants.USER_DATA)
	                    		strDbName = Utility.addToPath(this.getProperty(DBConstants.DB_USER_PREFIX), strDbName, DB_NAME_SEPARATOR);    // User prefix - Only for user data
	                if (Utility.getSystemSuffix(this.getProperty(DBConstants.SYSTEM_NAME), this.getProperty(DBConstants.DEFAULT_SYSTEM_NAME)) != null)
	                    if (!m_strDbName.equalsIgnoreCase(this.getProperty(SQLParams.INTERNAL_DB_NAME)))
	                    {
	                        if ((this.getDatabaseType() & DBConstants.TABLE_DATA_TYPE_MASK) == DBConstants.USER_DATA)
	                        	strDbName = Utility.addToPath(strDbName, Utility.getSystemSuffix(this.getProperty(DBConstants.SYSTEM_NAME), this.getProperty(DBConstants.DEFAULT_SYSTEM_NAME)), DB_NAME_SEPARATOR);	 // System suffix
	                        else if ((this.getDatabaseType() & DBConstants.TABLE_DATA_TYPE_MASK) == DBConstants.SHARED_DATA)
	                        {  // The shared database name is never changed, EXCEPT if the mode is set. Then there are a few exceptions
	                            if ((this.getProperty(DBConstants.MODE) == null) || (this.getProperty(DBConstants.MODE).length() == 0) || (this.getProperty(DBConstants.MODE).equalsIgnoreCase(RUN_MODE)))
                                {  // Default = Regular (run) mode
                                    if ((DEV_DATABASE.equalsIgnoreCase(m_strDbName)) || (MAIN_DATABASE.equalsIgnoreCase(m_strDbName)))
                                        strDbName = Utility.addToPath(strDbName, Utility.getSystemSuffix(this.getProperty(DBConstants.SYSTEM_NAME), this.getProperty(DBConstants.DEFAULT_SYSTEM_NAME)), DB_NAME_SEPARATOR);  // Add System suffix
                                }
                                else
                                {   // Development mode
                                    if (this.getProperty(DBConstants.MODE).length() >= 3)
	                                    if (this.getProperty(DBConstants.MODE).substring(0, 3).equalsIgnoreCase(DEVELOPMENT_MODE))
	                                {
	                                    if (DEV_DATABASE.equalsIgnoreCase(m_strDbName))
                                            strDbName = Utility.addToPath(strDbName, Utility.getSystemSuffix(this.getProperty(DBConstants.SYSTEM_NAME), this.getProperty(DBConstants.DEFAULT_SYSTEM_NAME)), DB_NAME_SEPARATOR);  // System suffix	                                        
	                                    if (MAIN_DATABASE.equalsIgnoreCase(m_strDbName))
	                                        strDbName = Utility.addToPath(strDbName, DEV_MAIN_SUFFIX, DB_NAME_SEPARATOR);  // Development menus
	                                }
                                }
	                        }
	                    }
                }
//x                if (this.getLocale() != null) //**THIS IS DONE IN makeDBLocale**
//x                	if ((this.getDatabaseType() & DBConstants.TABLE_DATA_TYPE_MASK) == DBConstants.SHARED_DATA)
//x                		if (this.getLocale() != this.getProperty(DBConstants.SYSTEM_NAME))
//x                			strDbName = strDbName + '_' + this.getLocale();
                if ((this.getDatabaseType() & DBConstants.TABLE_DATA_TYPE_MASK) == DBConstants.USER_DATA)
                    strDbName = Utility.addToPath(strDbName, USER_SUFFIX, DB_NAME_SEPARATOR);
                else if ((this.getDatabaseType() & DBConstants.TABLE_DATA_TYPE_MASK) == DBConstants.SHARED_DATA)
                    strDbName = Utility.addToPath(strDbName, SHARED_SUFFIX, DB_NAME_SEPARATOR);
            }
        }
        return strDbName;
    }
1331912
private function _getDefaultDB()
    {
        // For ReadDatabase checking Master first
        if ($this->_db) {
            return $this->_db;
        }
        
        if (!isset($this->db)) {
            get_instance()->load->database();
        }
        // No need to set as reference because $this->db is refered to &DB already.
        return get_instance()->db;
    }
604859
@POST
    @Path("getDatabaseProductName")    
	public String getDatabaseProductName(String id) throws SQLException {
		return DatabaseMetaDataHolder.get().get(id).getDatabaseProductName();
	}
720928
def dbname(self, value):
        
        self._dbname = value
        self._connectionXML.set('dbname', value)
93179
public static ParameterDef Default(final int sqlType) {
        return new ParameterDef(jdbcTypeMappings.get(sqlType),
                                parameterModeIn,
                                sqlType,
                                jdbcTypeNames.get(sqlType),
                                jdbcTypePrecisions.get(sqlType),
                                jdbcTypeScales.get(sqlType),
                                parameterNullableUnknown,
                                jdbcTypeSigns.get(sqlType));
    }
400028
public function getDefaultDatabase()
    {
        if (!isset($this->_config['database'])) {
            throw new Exception(sprintf('You have not configured a default database for Datasource %s yet.', $this->_config['name']));
        }
        $db = $this->_config['database'];
        return $this->connect()->database($db);
    }
21385
def get_sql(self, with_default_expression=True):
        '''
        
        '''
        if with_default_expression:
            if self.alias:
                return '%s ALIAS %s' % (self.db_type, self.alias)
            elif self.materialized:
                return '%s MATERIALIZED %s' % (self.db_type, self.materialized)
            else:
                default = self.to_db_string(self.default)
                return '%s DEFAULT %s' % (self.db_type, default)
        else:
            return self.db_type
862637
private String dbProp(String name) {

        String dbType = m_setupBean.getDatabase();
        Object prop = m_setupBean.getDatabaseProperties().get(dbType).get(dbType + "." + name);
        if (prop == null) {
            return "";
        }
        return prop.toString();
    }
529687
def _get_db_names(self, dbs, strict=True):
        
        dbs = utils.coerce_to_list(dbs)
        db_names = [utils.get_name(db) for db in dbs]
        if strict:
            good_dbs = self.instance.list_databases()
            good_names = [utils.get_name(good_db) for good_db in good_dbs]
            bad_names = [db_name for db_name in db_names
                    if db_name not in good_names]
            if bad_names:
                bad = ", ".join(bad_names)
                raise exc.NoSuchDatabase("The following database(s) were not "
                        "found: %s" % bad)
        return db_names
999866
@Override
	public SqlContext param(final String paramName, final Supplier<Object> supplier) {
		return this.param(paramName, supplier != null ? supplier.get() : null);
	}
486898
public void init(DatabaseOwner databaseOwner, String strDbName, int iDatabaseType, Map<String, Object> properties)
    {
        super.init(databaseOwner, strDbName, iDatabaseType, properties);

        this.setMasterSlave(RecordOwner.MASTER);      // This is in the client space (Don't execute Server Behaviors)
        
        this.setProperty(DBParams.MESSAGES_TO_REMOTE, DBConstants.FALSE);   // Sent by server version
        this.setProperty(DBParams.CREATE_REMOTE_FILTER, DBConstants.TRUE);  // Yes
        this.setProperty(DBParams.UPDATE_REMOTE_FILTER, DBConstants.FALSE); // Updated by server version
    }
737327
public static <ID, T extends Model> Finder<ID, T> withFinder() {
        return withFinder(DataSourceManager.getDefaultDataSourceName());
    }