diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-07-07 01:27:47 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-07-07 01:27:47 +1000 |
commit | 5791f5b8647e9d8623ace70b92f5af196cf43bc2 (patch) | |
tree | c873b2989d23116a19ec8cecacc6458cad34005b /examples/java | |
parent | 1fb879844911a83588db25a2ce23a7b7cd104e28 (diff) | |
download | mongo-5791f5b8647e9d8623ace70b92f5af196cf43bc2.tar.gz |
imported patch java-api
--HG--
rename : lang/python/Makefile.am => lang/java/Makefile.am
rename : lang/python/wiredtiger.i => lang/java/wiredtiger.i
Diffstat (limited to 'examples/java')
-rw-r--r-- | examples/java/Makefile.am | 0 | ||||
-rw-r--r-- | examples/java/ex_access.java | 17 |
2 files changed, 17 insertions, 0 deletions
diff --git a/examples/java/Makefile.am b/examples/java/Makefile.am new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/examples/java/Makefile.am diff --git a/examples/java/ex_access.java b/examples/java/ex_access.java new file mode 100644 index 00000000000..568919ed9c7 --- /dev/null +++ b/examples/java/ex_access.java @@ -0,0 +1,17 @@ +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); + } +} |