Hello,
I started to write couchbase client using java sdk.
I looked the following url and test a tiny code.
http://docs.couchbase.com/developer/java-2.1/java-intro.html
import com.couchbase.client.java.Cluster;
import com.couchbase.client.java.CouchbaseCluster;
import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.document.JsonDocument;
import com.couchbase.client.java.document.json.JsonObject;
class CouchbaseExample
{
public static void main(String args[])
{
Cluster cluster = CouchbaseCluster.create("172.17.0.3");
// Open the default bucket and the "beer-sample" one
Bucket bucket = cluster.openBucket("beer-sample");
JsonDocument walter = bucket.get("walter");
System.out.println("Found: " + walter.getString("firstname"));
cluster.disconnect();
}
}
$ mvn compile
[ERROR] /home/xxxx/java/cb-example/src/main/java/newtech/CouchbaseExample.java:[17,46] cannot find symbol
symbol: method getString(java.lang.String)
location: variable walter of type com.couchbase.client.java.document.JsonDocument
What am I wrong with my code ?
Thanks !