summaryrefslogtreecommitdiffstats
path: root/src/site/xdoc/index.xml
blob: dbd5bcb2ea234a1903f33c6db459295c9de412b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?xml version="1.0"?>

<document>
  <properties>
    <author email="javajedi@users.sf.net">Tim McCune</author>
    <title>Java Library for MS Access</title>
  </properties>
  <body>
    <section name="Jackcess">
      <p>
        Jackcess is a pure Java library for reading from and writing to MS
        Access databases.  It is part of the <a href="http://openhms.sourceforge.net/">OpenHMS</a> project from <a href="http://www.healthmarketscience.com/">Health Market Science, Inc.</a>.  It is not an application.  There is no GUI.  It's a
        library, intended for other developers to use to build Java
        applications.  Jackcess is licensed under the

        <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt">GNU Lesser General Public License</a>.
        Take a look
        at our <a href="faq.html">Frequently Asked Questions</a>
        for more info.
      </p>
    </section>
    <section name="Sample code">
        <ul>
          <li>Displaying the contents of a table:
            <source>System.out.println(Database.open(new File("my.mdb")).getTable("MyTable").display());
</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")
  .addColumn(new ColumnBuilder("a")
             .setSQLType(Types.INTEGER)
             .toColumn())
  .addColumn(new ColumnBuilder("b")
             .setSQLType(Types.VARCHAR)
             .toColumn())
  .toTable(db);
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>
          </li>
          <li>Copying the contents of a CSV file into a new table:
            <source>Database.open(new File("my.mdb")).importFile("Imported2", new File("my.csv"), ",");</source>
          </li>
        </ul>
    </section>
    <section name="Other Resources">
      Some other jackcess related projects:
      <ul>
        <li>
          <a href="http://www.tiyukquellmalz.org/jackcess-jdbc/">Jackcess-JDBC</a>
          - Open Source JDBC driver with read-only support for Access
          databases (by proxying the data through JavaDB)
        </li>
        <li>
          <a href="http://mdbtools.sf.net">mdbtools</a> - Open Source project
          for reading Access files, written in C.
        </li>
      </ul>
    </section>
  </body>
</document>