当前位置:网站首页>如何通过 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 重构脚本解释器
- About # SQL problem: how to set the following data by commas into multiple lines, in the form of column display
- 数据库无法启动,报无法分配内存,怎么处理
- 1076 Wifi Password (15 points)
- Test cases are hard?Just have a hand
- The easiest trick to support quick renaming of various files
- 1036 Programming with Obama (15 points)
- 1071 小赌怡情 (15 分)
- 1071 Small Gamble (15 points)
- 选择收银系统主要看哪些方面?
猜你喜欢
Find the latest staff salary and the last staff salary changes
leetcode: 69. Square root of x
分布式锁-Redission - 缓存一致性解决
Conditional statements in TF; where()
少年成就黑客,需要这些技能
leetcode:69. x 的平方根
JUC并发编程
1096 大美数 (15 分)
My creative anniversary丨Thank you for being with you for these 365 days, not forgetting the original intention, and each is wonderful
用 Antlr 重构脚本解释器
随机推荐
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
几何EX3 功夫牛宣布停售,入门级纯电产品为何总成弃子
分布式锁-Redission - 缓存一致性解决
About # SQL problem: how to set the following data by commas into multiple lines, in the form of column display
关于#sql#的问题:怎么将下面的数据按逗号分隔成多行,以列的形式展示出来
Four operations in TF
我的创作纪念日丨感恩这365天来有你相伴,不忘初心,各自精彩
3.2 - classification - Logistic regression
1.2 - error sources
【43. 字符串相乘】
Test cases are hard?Just have a hand
支持各种文件快速重命名最简单的小技巧
2.1-梯度下降
为什么会没有内存了呢
JRS303-Data Verification
1056 Sum of Combinations (15 points)
2022 China Soft Drink Market Insights
Write a resume like this, easy to get the interviewer
Distributed Lock-Redission - Cache Consistency Solution
4.1-支持向量机