private boolean checkForDBExistence() throws ClientProtocolException, IOException, URISyntaxException
    {
        URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(),
                CouchDBConstants.URL_SEPARATOR + databaseName.toLowerCase(), null, null);

        HttpGet get = new HttpGet(uri);
        HttpResponse getRes = null;
        try
        {
            // creating database.
            getRes = httpClient.execute(httpHost, get, CouchDBUtils.getContext(httpHost));
            if (getRes.getStatusLine().getStatusCode() == HttpStatus.SC_OK)
            {
                return true;
            }
            return false;
        }
        finally
        {
            CouchDBUtils.closeContent(getRes);
        }
    }
private boolean checkForDBExistence ( ) throws ClientProtocolException , IOException , URISyntaxException { URI uri = new URI ( CouchDBConstants . PROTOCOL , null , httpHost . getHostName ( ) , httpHost . getPort ( ) , CouchDBConstants . URL_SEPARATOR + databaseName . toLowerCase ( ) , null , null ) ; HttpGet get = new HttpGet ( uri ) ; HttpResponse getRes = null ; try { getRes = httpClient . execute ( httpHost , get , CouchDBUtils . getContext ( httpHost ) ) ; if ( getRes . getStatusLine ( ) . getStatusCode ( ) == HttpStatus . SC_OK ) { return true ; } return false ; } finally { CouchDBUtils . closeContent ( getRes ) ; } }
Check for db existence.

@return true, if successful
@throws ClientProtocolException
the client protocol exception
@throws IOException
Signals that an I/O exception has occurred.
@throws URISyntaxException
the URI syntax exception