Add in examples to Java build.

This commit is contained in:
Alex Gorrod
2013-01-25 12:48:02 +11:00
parent 90e7314eb3
commit 697825e73b
6 changed files with 83 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package com.wiredtiger.examples;
import com.wiredtiger.db.*;
public class ex_access {
public static void main(String[] args) {
Connection conn = wiredtiger.open("WT_HOME", "create");
Session s = conn.open_session(null);
s.create("table:t", "key_format=S,value_format=u");
Cursor c = s.open_cursor("table:t", null, null);
c.set_key("foo");
c.set_value("bar".getBytes());
c.insert();
c.reset();
while (c.next() == 0)
System.out.println("Got: " + c.get_key());
conn.close(null);
}
}