I'm currently working on a project using ektorp and I am testing my database connection like this.
Step 1 -- Connect to the HttpClient as you have done
HttpClient httpClient = new StdHttpClient.Builder()
.host("localhost")
.port("5984")
.username("")
.password("");
/* no user name and password required because, its admin party */
CouchDbInstance couchDbInstance = new StdCouchDbInstance(httpClient);
Step 2 -- Create a CouchDbInstance
CouchDbInstance dbInstance = new StdCouchDbInstance(httpClient);
Step 3 -- Use CouchDbConnector to connect to a specific database in your localhost CouchDB (in this example my database is called albums but you just put in the name for whatever database you are connecting to in place of albums from where you are coding)
CouchDbConnector albums = dbInstance.createConnector("albums", true);
Step 4 -- You can print off the name of the database you are connected to like this.
System.out.println(albums.getDatabaseName());
You could also create an endpoint that would print the name of the database you are connected to in the browser by creating a method of type string with
return albums.getDatabaseName();
I hope this is helpful. I used ektorp's reference documentation to learn this. It took me a while to figure out how to use ektorp like this and I am still learning!