跳转至

Access Writer

Access Writer 插件实现了写入数据到 Access 目的表的功能。

示例

假定要写入的 Access 表建表语句如下:

create table tbl_test(name varchar(20), file_size int, file_date date, file_open boolean, memo blob);

这里使用一份从内存产生到 Access 导入的数据。

{
  "job": {
    "setting": {
      "speed": {
        "channel": 1,
        "bytes": -1
      }
    },
    "content": {
      "reader": {
        "name": "streamreader",
        "parameter": {
          "column": [
            {
              "value": "Addax",
              "type": "string"
            },
            {
              "value": 19880808,
              "type": "long"
            },
            {
              "value": "1988-08-08 08:08:08",
              "type": "date"
            },
            {
              "value": true,
              "type": "bool"
            },
            {
              "value": "test",
              "type": "bytes"
            }
          ],
          "sliceRecordCount": 1000
        }
      },
      "writer": {
        "name": "accesswriter",
        "parameter": {
          "username": "wgzhao",
          "password": "",
          "column": [
            "name",
            "file_size",
            "file_date",
            "file_open",
            "memo"
          ],
          "ddl": "create table tbl_test(name varchar(20), file_size int, file_date date, file_open boolean, memo blob);",
          "connection": {
            "jdbcUrl": "jdbc:ucanaccess:////Users/wgzhao/Downloads/AccessThemeDemo.mdb",
            "table": [
              "tbl_test"
            ]
          }
        }
      }
    }
  }
}

将上述配置文件保存为 job/stream2access.json

执行采集命令

执行以下命令进行数据采集

bin/addax.sh job/stream2access.json

参数说明

该插件基于 RDBMS Writer 实现,因此可以参考 RDBMS Writer 的所有配置项。