You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.xml 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0"?>
  2. <document>
  3. <properties>
  4. <author email="javajedi@users.sf.net">Tim McCune</author>
  5. </properties>
  6. <body>
  7. <section name="Jackcess">
  8. <p>
  9. Jackcess ia a pure Java library for reading from and
  10. writing to MS Access databases. It is not an application.
  11. There is no GUI. It's a library, intended for other
  12. developers to use to build Java applications. Take a look
  13. at our <a href="faq.html">Frequently Asked Questions</a>
  14. for more info.
  15. </p>
  16. </section>
  17. <section name="Sample code">
  18. <p>
  19. <ul>
  20. <li>Displaying the contents of a table:
  21. <pre>Database.open(new File("my.mdb")).getTable("MyTable").display();</pre>
  22. </li>
  23. <li>Creating a new table and writing data into it:
  24. <pre>Database db = Database.create(new File("new.mdb"));
  25. Column a = new Column();
  26. a.setName("a");
  27. a.setSQLType(Types.INTEGER);
  28. Column b = new Column();
  29. b.setName("b");
  30. b.setSQLType(Types.VARCHAR);
  31. db.createTable("NewTable", Arrays.asList(a, b));
  32. Table newTable = db.getTable("NewTable");
  33. newTable.addRow(new Object[] {1, "foo"});</pre>
  34. </li>
  35. <li>Copying the contents of a JDBC ResultSet (e.g. from an
  36. external database) into a new table:
  37. <pre>Database.open(new File("my.mdb")).copyTable("Imported", resultSet);</pre>
  38. </li>
  39. <li>Copying the contents of a CSV file into a new table:
  40. <pre>Database.open(new File("my.mdb")).importFile("Imported2", new File("my.csv"), ",");</pre>
  41. </li>
  42. </ul>
  43. </p>
  44. </section>
  45. </body>
  46. </document>