public Database getDatabase(String strDBName, int iDatabaseType, Map<String, Object> properties)
    {
        if ((strDBName == null) || (strDBName.length() == 0))
            return null;
        Database database = this.getDatabaseList(iDatabaseType).get(strDBName);
        if (database == null)
        {
            if ((properties != null)
            	&& (DBConstants.FALSE.equals(properties.get(DBConstants.CREATE_DB_IF_NOT_FOUND)))
            	&& (Environment.DATABASE_DOESNT_EXIST == ((Environment)m_databaseOwner.getEnvironment()).getCachedDatabaseProperties(strDBName)))
            		return null;	// Hey, if the database doesn't exist, don't try again.
            if (iDatabaseType != DBConstants.SCREEN)
                database = this.makeDatabase(iDatabaseType);    // BaseDatabase not found, open it!
            else
                database = new BaseDatabase();                  // Special case: A screen database
            if (database != null)
                database.init(m_databaseOwner, strDBName, iDatabaseType & DBConstants.TABLE_MASK, properties); // init it!
            if (database != null)
            {
                try   {
                    ((BaseDatabase)database).open();    // open it!
                } catch (DBException ex) {
                    database.free();
                    database = null;    // Failure on db open
                    if ((ex.getErrorCode() == DBConstants.DB_NOT_FOUND)
                		&& (properties != null)
                        && (DBConstants.FALSE.equals(properties.get(DBConstants.CREATE_DB_IF_NOT_FOUND))))
                    {	// If the db doesn't exist, cache the name so I won't try this (expensive) operation again
                        ((Environment)m_databaseOwner.getEnvironment()).cacheDatabaseProperties(strDBName, Environment.DATABASE_DOESNT_EXIST);
                    }
                }
            }
        }
        return database;
    }
public Database getDatabase ( String strDBName , int iDatabaseType , Map < String , Object > properties ) { if ( ( strDBName == null ) || ( strDBName . length ( ) == 0 ) ) return null ; Database database = this . getDatabaseList ( iDatabaseType ) . get ( strDBName ) ; if ( database == null ) { if ( ( properties != null ) && ( DBConstants . FALSE . equals ( properties . get ( DBConstants . CREATE_DB_IF_NOT_FOUND ) ) ) && ( Environment . DATABASE_DOESNT_EXIST == ( ( Environment ) m_databaseOwner . getEnvironment ( ) ) . getCachedDatabaseProperties ( strDBName ) ) ) return null ; if ( iDatabaseType != DBConstants . SCREEN ) database = this . makeDatabase ( iDatabaseType ) ; else database = new BaseDatabase ( ) ; if ( database != null ) database . init ( m_databaseOwner , strDBName , iDatabaseType & DBConstants . TABLE_MASK , properties ) ; if ( database != null ) { try { ( ( BaseDatabase ) database ) . open ( ) ; } catch ( DBException ex ) { database . free ( ) ; database = null ; if ( ( ex . getErrorCode ( ) == DBConstants . DB_NOT_FOUND ) && ( properties != null ) && ( DBConstants . FALSE . equals ( properties . get ( DBConstants . CREATE_DB_IF_NOT_FOUND ) ) ) ) { ( ( Environment ) m_databaseOwner . getEnvironment ( ) ) . cacheDatabaseProperties ( strDBName , Environment . DATABASE_DOESNT_EXIST ) ; } } } } return database ; }
Given the name, either get the open database, or open a new one.
@param strDBName The name of the database.
@param iDatabaseType The type of database/table.
@return The database (new or current).