public boolean setupDatabaseProperties ( ) { if ( this . getProperty ( DB_PROPERTIES_LOADED ) != null ) return true ; // Already setup String strDatabaseName = this . getDatabaseName ( true ) ; Environment env = ( Environment ) this . getDatabaseOwner ( ) . getEnvironment ( ) ; Map < String , String > map = env . getCachedDatabaseProperties ( strDatabaseName ) ; if ( ( map == null ) || ( map == Environment . DATABASE_DOESNT_EXIST ) ) { map = this . getDatabaseProperties ( ) ; if ( map == null ) return false ; // Was not set up env . cacheDatabaseProperties ( strDatabaseName , map ) ; // Update the cache } for ( String key : map . keySet ( ) ) { this . setProperty ( key , map . get ( key ) ) ; } if ( m_databaseBase == null ) // Always if ( this . getProperty ( BASE_DATABASE ) != null ) { Map < String , Object > properties = new HashMap < String , Object > ( ) ; properties . putAll ( this . getProperties ( ) ) ; properties . remove ( BASE_DATABASE ) ; properties . remove ( SQLParams . JDBC_DRIVER_PARAM ) ; properties . put ( DBConstants . DB_USER_PREFIX , DBConstants . BLANK ) ; properties . remove ( DBConstants . SYSTEM_NAME ) ; properties . put ( DBConstants . MODE , DBConstants . BLANK ) ; m_databaseBase = ( BaseDatabase ) m_databaseOwner . getDatabase ( this . getProperty ( BASE_DATABASE ) , this . getDatabaseType ( ) & DBConstants . TABLE_MASK , properties ) ; } this . setProperty ( DB_PROPERTIES_LOADED , DBConstants . TRUE ) ; // Flag properties as read return true ; // Success }
Given the name of the database get the properties file and optionally merge them with my current properties .