You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by "Leucht, Axel" <Ax...@prodv.de> on 2010/05/27 12:07:23 UTC

Couchdb via java

I'm currently evaluating couchdb as a database for one of our web
applications.

This scenario requires couchdb to be used from java. Therefore I
downloaded couchdb-0.11.0 and couchdb4j-0.1.2.jar. 

I did install couchdb on my Windows-XP box and it runs fine:
	{"couchdb":"Welcome","version":"0.11.0"}
Then I inserted two simple documents and tried to "query" it with the
following java program:

Session s = new Session("localhost", 5984);
Database db = s.getDatabase("mydb");
ViewResults result = db.getAllDocuments(); 		
for (Document d : result.getResults()) {
	System.out.println("id:"+d.getId());	 // Oops
	String id = (String) d.get("id");
	System.out.println("id:"+id); 		// Here "id" is correct

	Document full = db.getDocument(d.getId());	
	System.out.println("Name:"+full.getString("name"));
}

Problem is that the document Ids are not returned. But the program
reports the proper id when getting the field directly. 

What gives?

/Axel

/Axel

Re: Couchdb via java

Posted by Nils Breunese <N....@vpro.nl>.
Daniel Truemper wrote:

> Have you tried jcouchdb or jrelax?
>
> http://code.google.com/p/jcouchdb
> http://github.com/isterin/jrelax

I also ran into Ektorp recently, though I haven't tried it yet:
http://code.google.com/p/ektorp/

I'm using jcouchdb at the moment myself.

Nils.

De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde. De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mail, noch voor tijdige ontvangst daarvan.

Re: Couchdb via java

Posted by Daniel Truemper <tr...@googlemail.com>.
> couchdb4j continues development at http://github.com/mbreese/couchdb4j
Ah, cool! Did not know that!

> On Thu, May 27, 2010 at 07:15, Daniel Truemper <tr...@googlemail.com>wrote:
> 
>> 
>>> I'm currently evaluating couchdb as a database for one of our web
>>> applications.
>>> 
>>> This scenario requires couchdb to be used from java. Therefore I
>>> downloaded couchdb-0.11.0 and couchdb4j-0.1.2.jar.
>> Hm, I think couchdb4j is discontinued. At least there has not been any real
>> code commit since Sep. 2008.
>> 
>> Have you tried jcouchdb or jrelax?
>> 
>> http://code.google.com/p/jcouchdb
>> http://github.com/isterin/jrelax
>> 
>> Daniel
>> 
>> 


Re: Couchdb via java

Posted by Luke Driscoll <lu...@gmail.com>.
couchdb4j continues development at http://github.com/mbreese/couchdb4j

On Thu, May 27, 2010 at 07:15, Daniel Truemper <tr...@googlemail.com>wrote:

>
> > I'm currently evaluating couchdb as a database for one of our web
> > applications.
> >
> > This scenario requires couchdb to be used from java. Therefore I
> > downloaded couchdb-0.11.0 and couchdb4j-0.1.2.jar.
> Hm, I think couchdb4j is discontinued. At least there has not been any real
> code commit since Sep. 2008.
>
> Have you tried jcouchdb or jrelax?
>
> http://code.google.com/p/jcouchdb
> http://github.com/isterin/jrelax
>
> Daniel
>
>

Re: Couchdb via java

Posted by Daniel Truemper <tr...@googlemail.com>.
> I'm currently evaluating couchdb as a database for one of our web
> applications.
> 
> This scenario requires couchdb to be used from java. Therefore I
> downloaded couchdb-0.11.0 and couchdb4j-0.1.2.jar. 
Hm, I think couchdb4j is discontinued. At least there has not been any real code commit since Sep. 2008.

Have you tried jcouchdb or jrelax?

http://code.google.com/p/jcouchdb
http://github.com/isterin/jrelax

Daniel


Re: Couchdb via java

Posted by Daniel Truemper <tr...@googlemail.com>.
> The reason I started using couchdb4j because it fully supports json-lib, and
> json-lib has some nice XML-JSON conversion tools, which I am using.
This sounds interesting! Will have a look at this when I have some time!

Daniel

Re: Couchdb via java

Posted by Luke Driscoll <lu...@gmail.com>.
The reason I started using couchdb4j because it fully supports json-lib, and
json-lib has some nice XML-JSON conversion tools, which I am using.

Luke

On Thu, May 27, 2010 at 09:05, Jarrod Roberson <ja...@vertigrated.com>wrote:

> I would recommend spending you effort on jcouchdb instead
>
> Jarrod Roberson
> 678-551-2852
>
> On May 27, 2010, at 6:07 AM, "Leucht, Axel" <Ax...@prodv.de>
> wrote:
>
> > I'm currently evaluating couchdb as a database for one of our web
> > applications.
> >
> > This scenario requires couchdb to be used from java. Therefore I
> > downloaded couchdb-0.11.0 and couchdb4j-0.1.2.jar.
> >
> > I did install couchdb on my Windows-XP box and it runs fine:
> >    {"couchdb":"Welcome","version":"0.11.0"}
> > Then I inserted two simple documents and tried to "query" it with the
> > following java program:
> >
> > Session s = new Session("localhost", 5984);
> > Database db = s.getDatabase("mydb");
> > ViewResults result = db.getAllDocuments();
> > for (Document d : result.getResults()) {
> >    System.out.println("id:"+d.getId());     // Oops
> >    String id = (String) d.get("id");
> >    System.out.println("id:"+id);        // Here "id" is correct
> >
> >    Document full = db.getDocument(d.getId());
> >    System.out.println("Name:"+full.getString("name"));
> > }
> >
> > Problem is that the document Ids are not returned. But the program
> > reports the proper id when getting the field directly.
> >
> > What gives?
> >
> > /Axel
> >
> > /Axel
>

Re: Couchdb via java

Posted by Jarrod Roberson <ja...@vertigrated.com>.
I would recommend spending you effort on jcouchdb instead

Jarrod Roberson
678-551-2852

On May 27, 2010, at 6:07 AM, "Leucht, Axel" <Ax...@prodv.de>
wrote:

> I'm currently evaluating couchdb as a database for one of our web
> applications.
>
> This scenario requires couchdb to be used from java. Therefore I
> downloaded couchdb-0.11.0 and couchdb4j-0.1.2.jar.
>
> I did install couchdb on my Windows-XP box and it runs fine:
>    {"couchdb":"Welcome","version":"0.11.0"}
> Then I inserted two simple documents and tried to "query" it with the
> following java program:
>
> Session s = new Session("localhost", 5984);
> Database db = s.getDatabase("mydb");
> ViewResults result = db.getAllDocuments();
> for (Document d : result.getResults()) {
>    System.out.println("id:"+d.getId());     // Oops
>    String id = (String) d.get("id");
>    System.out.println("id:"+id);        // Here "id" is correct
>
>    Document full = db.getDocument(d.getId());
>    System.out.println("Name:"+full.getString("name"));
> }
>
> Problem is that the document Ids are not returned. But the program
> reports the proper id when getting the field directly.
>
> What gives?
>
> /Axel
>
> /Axel