aboutsummaryrefslogtreecommitdiffstats
path: root/src/site
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2010-09-22 01:34:46 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2010-09-22 01:34:46 +0000
commitd540734522032635486d12cc650a2a7c2da7ca5f (patch)
treea9f8ec3ba5e56ff602d87ddd75939522e425ab51 /src/site
parentf37992d8d27e52c97106caea943230f513187eef (diff)
downloadjackcess-d540734522032635486d12cc650a2a7c2da7ca5f.tar.gz
jackcess-d540734522032635486d12cc650a2a7c2da7ca5f.zip
add some more examples
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@484 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/site')
-rw-r--r--src/site/xdoc/index.xml17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
index 7dabdae..d42542a 100644
--- a/src/site/xdoc/index.xml
+++ b/src/site/xdoc/index.xml
@@ -25,6 +25,22 @@
<source>System.out.println(Database.open(new File("my.mdb")).getTable("MyTable").display());
</source>
</li>
+ <li>Iterating through the rows of a table:
+ <source>Table table = Database.open(new File("my.mdb")).getTable("MyTable");
+for(Map&lt;String, Object&gt; row : table) {
+ System.out.println("Column 'a' has value: " + row.get("a"));
+}
+</source>
+ </li>
+ <li>Searching for a row with a specific column value:
+ <source>Map&lt;String, Object&gt; row = Cursor.findRow(table, Collections.singletonMap("a", "foo"));
+if(row != null) {
+ System.out.println("Found row where 'a' == 'foo': " + row);
+} else {
+ System.out.println("Could not find row where 'a' == 'foo'");
+}
+</source>
+ </li>
<li>Creating a new table and writing data into it:
<source>Database db = Database.create(new File("new.mdb"));
Table newTable = new TableBuilder("NewTable")
@@ -38,6 +54,7 @@ Table newTable = new TableBuilder("NewTable")
newTable.addRow(1, "foo");
</source>
</li>
+
<li>Copying the contents of a JDBC ResultSet (e.g. from an
external database) into a new table:
<source>Database.open(new File("my.mdb")).copyTable("Imported", resultSet);</source>