public String getDatabase ( ) { int indexSlash = url . indexOf ( "/" , url . indexOf ( "://" ) + 3 ) ; int questionMarkIndex = url . indexOf ( "?" ) ; if ( questionMarkIndex != - 1 ) { return url . substring ( indexSlash + 1 , questionMarkIndex ) ; } else { return url . substring ( indexSlash + 1 ) ; } }
parse the databse url and get he database name