当前位置:网站首页>如何通过 IDEA 数据库管理工具连接 TDengine?
如何通过 IDEA 数据库管理工具连接 TDengine?
2022-08-11 07:56:00 【涛思数据TDengine】
前言:两年前,我们有篇博客介绍了如何通过 IDEA database 工具连接 TDengine,但这段时间以来 TDengine、taos-jdbcdriver 有了很大的迭代更新,JDBC Connector 已经从 TDengine 仓库中独立出来。社区中有些用户表示在使用 IDEA database 连接 TDengine 时会报错,于是,我们决定重新写一篇有关 IDEA 数据库管理工具连接 TDengine 的文章。本篇博客以目前 2.0.39 版本的 JDBC Connector 为例,介绍如何使用源码编译、打包,以及如何使用 IDEA 数据库工具连接 TDengine。
源码编译 JDBC-Connector
- 首先从 GitHub 仓库克隆 JDBC 连接器的源码,
git clone https://github.com/taosdata/taos-connector-jdbc.git
(需要旧版本可以 -b 指定对应版本分支),或者设置:
- 在 taos-connector-jdbc 目录下执行:mvn clean package -Dmaven.test.skip=true
使用 IDEA database 连接 TDengine
- 打开 IDEA database 工具,在驱动中添加 target 文件夹下的 taos-jdbcdriver-2.0.39-dist.jar。
- 选择 RESTful 方式进行连接(注意:使用 com.taosdata.jdbc.TSDBDriver 驱动类需要安装 TDengine 客户端)。
- 然后通过驱动创建数据源。TDengine 的 JDBC URL 规范为:
jdbc:[TAOS|TAOS-RS]://[host_name]:[port]/[database_name]?[user={user}|&password={password}|&charset={charset}|&cfgdir={config_dir}|&locale={locale}|&timezone={timezone}]
- 使用 RESTful 连接,此处 URL 示例为:
jdbc:TAOS-RS://VM-24-8-centos:6041/log
- ( 此处使用域名需要在 Hosts 文件内添加解析;URL 内的 locale、timezone 参数在 RESTful 连接中不生效)
- 点击测试连接,出现黄色感叹号不影响使用。
- 配置完后,右击数据源,新建查询控制台测试能否查询。需要注意的是,RESTful 请求是无状态的,查询、写入需要在表名前带上数据库名:
- 2.X 版本中默认带 log 库,可以使用
SHOW log.stables
查看包含哪些超级表后对特定表进行查询、调试。
感谢您阅读本篇博客,希望以上内容对您有帮助。您在使用 TDengine 这款 Time Series Database 的过程中,若遇到棘手的问题或对 TDengine 有改进意见,欢迎在 GitHub 上给我们提 Issue ,内容越详细越好,也可vx添加小 T (tdengine)为好友加入社区,与大家进行交流 ~ 最后,感谢使用 TDengine!
边栏推荐
- Redis source code: how to view the Redis source code, the order of viewing the Redis source code, the sequence of the source code from the external data structure of Redis to the internal data structu
- Four operations in TF
- 1002 写出这个数 (20 分)
- 1003 I want to pass (20 points)
- 1.1-回归
- 1091 N-Defensive Number (15 points)
- My creative anniversary丨Thank you for being with you for these 365 days, not forgetting the original intention, and each is wonderful
- 1071 小赌怡情 (15 分)
- oracle19c does not support real-time synchronization parameters, do you guys have any good solutions?
- tf.cast(), reduce_min(), reduce_max()
猜你喜欢
随机推荐
1076 Wifi密码 (15 分)
Two state forms of Service
为什么会没有内存了呢
关于Excel实现分组求和最全文档
The softmax function is used in TF;
matrix multiplication in tf
tf.reduce_mean()与tf.reduce_sum()
JRS303-数据校验
链式编程注解
Two startup methods and differences of Service
囍楽cloud task source code
欧拉函数(用欧拉筛法求欧拉函数)
1.2-误差来源
[C语言] sscanf如何实现sscanf_s?
4.1ROS运行管理/launch文件
8、Mip-NeRF
redis operation
流式结构化数据计算语言的进化与新选择
About # SQL problem: how to set the following data by commas into multiple lines, in the form of column display
租房小程序