当前位置:网站首页>如何通过 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!
边栏推荐
猜你喜欢
用 Antlr 重构脚本解释器
JRS303-数据校验
3.2-分类-Logistic回归
Redis source code-String: Redis String command, Redis String storage principle, three encoding types of Redis string, Redis String SDS source code analysis, Redis String application scenarios
记录一些遇见的bug——Lombok和Mapstruct的冲突导致,A component required a bean of type ‘com.XXX.controller.converter.
Item 2 - Annual Income Judgment
3.1-分类-概率生成模型
1071 Small Gamble (15 points)
The easiest trick to support quick renaming of various files
3.1-Classification-probabilistic generative model
随机推荐
【云原生】云原生在网络安全领域的应用
One-hot in TF
[C语言] sscanf如何实现sscanf_s?
1046 punches (15 points)
Write a resume like this, easy to get the interviewer
Four startup modes of Activity
leetcode:69. x 的平方根
Two state forms of Service
1002 Write the number (20 points)
分布式锁-Redission - 缓存一致性解决
【LeetCode】链表题解汇总
1046 划拳 (15 分)
Redis source code-String: Redis String command, Redis String storage principle, three encoding types of Redis string, Redis String SDS source code analysis, Redis String application scenarios
4.1-支持向量机
The easiest trick to support quick renaming of various files
链式编程注解
JRS303-数据校验
机器学习(二)线性回归
Break pad source code compilation--refer to the summary of the big blogger
TF中使用softmax函数;