public String getHost ( ) { String hostAndPort = hostAndPort ( ) ; int indexOfMaohao = hostAndPort . indexOf ( ":" ) ; if ( indexOfMaohao == - 1 ) { return hostAndPort ; } else { return hostAndPort . substring ( 0 , indexOfMaohao ) ; } }
parse database url and get the host .