Jackcess

来源:互联网 发布:天津工业大学网络教学 编辑:程序博客网 时间:2024/06/04 18:45
Jackcess is a pure Java library for reading from and writing to MS Access databases (currently supporting versions 2000-2013)

Jackcess

public class MyJackessTest {    public static void main(String[] args) throws IOException {        Database database = DatabaseBuilder.open(new File("C:\\xxx.accdb"));        for (String s : database.getTableNames()) {            System.out.println(s);            Table table = database.getTable(s);            for (Row row : table) {                System.out.println(row);            }            Map map = new HashMap();            map.put("ID", 1);            map.put("USERNAME", "aaa");            Row row = CursorBuilder.findRow(table,map);            if (row != null) {                System.out.println("found row "+row);            } else {                System.out.println("not found");            }        }    }}

这里写图片描述

pom.xml

 <dependencies>        <dependency>            <groupId>com.healthmarketscience.jackcess</groupId>            <artifactId>jackcess</artifactId>            <version>2.0.2</version>        </dependency>    </dependencies>
0 0
原创粉丝点击