tags:

views:

1981

answers:

2

Which libraries are people using for CouchDB? I just finished getting couchdb4j running successfully, it seems to have some clunkiness. I was going to try jcouchdb, but this effort is starting to irritate me enough, and the CouchDB API is simple enough, that I'm tempted to just use httpclient and a JSON library.

Edit: grrrrr... neither one has anything but the most meagre of examples.

+4  A: 

Warner Onstine recently proposed on couchdb-user that jcouchdb be the community-sactioned Java library for CouchDB. After some testing, he claims that jcouchdb is the most complete API. I haven't used either myself, so I can only provide a pointer to the thread.

Barry Wark
Thanks, I seem to have got jcouchdb working more easily than couchdb4j. I was just turned off at first by the use of "svenson" for JSON handling.... I have a hard time interpreting quirky-named libraries as Reputable libraries.
Jason S
Sorry for the name.. I couldn't come up with one so a coworker asked: "So, what's special about it?" to which I jokingly replied "It's *my* JSON library, of course.", continuing a previous discussion about the not-invented-here syndrome.In spite of that joke I still feel like svenson is a useful addition to the JSON libraries out there of which only Jackson seems to be comparable and that came into existence after the initial svenson versions.
fforw
While this was probably the best solution a year ago, it is no longer the case. Development on jcouchdb is sporadic, at best, and lags far behind contemporary clients, such as Ektorp. The latter is far more featureful and active. There is also much saner exception-handling (jcouchdb simply catches and logs many exceptions, simply returning null, such that the caller has no idea what the problem was).
@user359996 That's the point of SO's voting system. As you can see, a post pointing to Ektorp has more votes than this answer. I'll leave this here, for historical context, but let future users vote it up/down as other options become more useful.
Barry Wark
+7  A: 

I suggest you take a look at Ektorp a new Java CouchDB connector library. It uses Jackson JSON Processor for the object mapping and has a clean API.

henrik_lundgren
I would also recommend Ektorp. I tried couchdb4j and jcouchdb and neither really seems to easily support attachments. Further, the community around Ektorp is currently more active making support in just getting things working much nicer.
jeffjakub
+1 Another benefit is they don't try and ram object-mapping down your throat--you can work with Jackson's low-level JsonNodes or even maps just as easily as annotated classes.
And proper documentation, too!