code: private void createDatabaseIfNotExist(boolean drop) throws URISyntaxException, IOException, ClientProtocolException
      {
          boolean exist = checkForDBExistence();
  
          if (exist && drop)
          {
              dropDatabase();
              exist = false;
          }
          if (!exist)
          {
              URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(),
                      CouchDBConstants.URL_SEPARATOR + databaseName.toLowerCase(), null, null);
  
              HttpPut put = new HttpPut(uri);
              HttpResponse putRes = null;
              try
              {
                  // creating database.
                  putRes = httpClient.execute(httpHost, put, CouchDBUtils.getContext(httpHost));
              }
              finally
              {
                  CouchDBUtils.closeContent(putRes);
              }
          }
      }
docs: Creates the database if not exist.
  
  @param drop
  the drop
  @throws URISyntaxException
  the URI syntax exception
  @throws IOException
  Signals that an I/O exception has occurred.
  @throws ClientProtocolException
  the client protocol exception