tree: c1cc8311e6a5669b9b17e564cb309b83038f761e [path history] [tgz]
  1. ODBC-Example/
  2. .gitignore
  3. ODBC-Example.sln
  4. README.md
example/odbc/README.md

ODBC

With IoTDB JDBC, IoTDB can be accessed using the ODBC-JDBC bridge. The example program in “odbc” can write and read data through ODBC using the bridge.

Dependencies

  • IoTDB-JDBC's jar-with-dependency package
  • ODBC-JDBC bridge (e.g. ZappySys JDBC Bridge)

Deployment

Preparing JDBC package

Download the source code of IoTDB, and execute the following command in root directory:

mvn clean package -pl iotdb-client/jdbc -am -DskipTests -P get-jar-with-dependencies

Then, you can see the output iotdb-jdbc-1.3.2-SNAPSHOT-jar-with-dependencies.jar under iotdb-client/jdbc/target directory.

Preparing ODBC-JDBC Bridge

Note: Here we only provide one kind of ODBC-JDBC bridge as the instance. Readers can use other ODBC-JDBC bridges to access IoTDB with the IOTDB-JDBC.

  1. Download Zappy-Sys ODBC-JDBC Bridge: Enter the https://zappysys.com/products/odbc-powerpack/odbc-jdbc-bridge-driver/ website, and click “download”.

    ZappySys_website.jpg

  2. Prepare IoTDB: Set up IoTDB cluster, and write a row of data arbitrarily.

    IoTDB > insert into root.ln.wf02.wt02(timestamp,status) values(1,true)
    
  3. Deploy and Test the Bridge:

    1. Open ODBC Data Sources(32/64 bit), depending on the bits of Windows. One possible position is C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools.

      ODBC_ADD_EN.jpg

    2. Click on “add” and select ZappySys JDBC Bridge.

      ODBC_CREATE_EN.jpg

    3. Fill in the following settings:

      PropertyContentExample
      Connection Stringjdbc:iotdb://<The IP of IoTDB>:<The rpc port of IoTDB>/jdbc:iotdb://127.0.0.1:6667/
      Driver Classorg.apache.iotdb.jdbc.IoTDBDriverorg.apache.iotdb.jdbc.IoTDBDriver
      JDBC driver file(s)The path of IoTDB JDBC jar-with-dependenciesC:\Users\13361\Documents\GitHub\iotdb\iotdb-client\jdbc\target\iotdb-jdbc-1.3.2-SNAPSHOT-jar-with-dependencies.jar
      User nameIoTDB's user nameroot
      User passwordIoTDB's passwordroot

      ODBC_CONNECTION.png

    4. Click on “Test Connection” button, and a “Test Connection: SUCCESSFUL” should appear.

      ODBC_CONFIG_EN.jpg

    5. Click the “Preview” button above, and replace the original query text with select * from root.**, then click “Preview Data”, and the query result should correctly.

      ODBC_TEST.jpg

Operate IoTDB's data with ODBC example

After correct deployment, you can use the example program to operate IoTDB's data.

This program can write data into IoTDB, and query the data we have just written. You can directly open the “odbc-example” with JetBrains Rider and run it.