Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Apache IoTDB client interface

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use the Apache IoTDB client interface". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor learn how to use the Apache IoTDB client interface.

JDBC interface

JDBC is not only the standard interface of relational database, but also the most familiar interface. So we provided this interface from the very beginning.

In the same way as standard JDBC, you need to load database driver classes, establish connections, establish Statement, and execute statements through Statement. For non-queries, batch execution can reduce the number of network transmissions. Here is a simple example

Public static void main (String [] args) throws ClassNotFoundException, SQLException {Class.forName ("org.apache.iotdb.jdbc.IoTDBDriver"); try (Connection connection = DriverManager .getConnection ("jdbc:iotdb://127.0.0.1:6667/", "root", "root"); Statement statement = connection.createStatement () {/ / create storage group statement.execute ("SET STORAGE GROUP TO root.sg1") / / create time series statement.execute ("CREATE TIMESERIES root.sg1.d1.s1 WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY"); statement.execute ("CREATE TIMESERIES root.sg1.d1.s2 WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY"); statement.execute ("CREATE TIMESERIES root.sg1.d1.s3 WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY"); / / accumulate a batch of update statements for (int I = 0; I) on the client side

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report