Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
84afe48a
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
84afe48a
编写于
8月 24, 2021
作者:
Z
zyyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change
上级
bf36b4c5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
9 deletion
+8
-9
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBError.java
...ector/jdbc/src/main/java/com/taosdata/jdbc/TSDBError.java
+1
-0
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java
...dbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java
+2
-0
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java
...dbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java
+4
-9
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SetConfigurationInJNITest.java
...est/java/com/taosdata/jdbc/SetConfigurationInJNITest.java
+1
-0
未找到文件。
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBError.java
浏览文件 @
84afe48a
...
...
@@ -35,6 +35,7 @@ public class TSDBError {
TSDBErrorMap
.
put
(
TSDBErrorNumbers
.
ERROR_UNKNOWN_TIMESTAMP_PRECISION
,
"unknown timestamp precision"
);
TSDBErrorMap
.
put
(
TSDBErrorNumbers
.
ERROR_USER_IS_REQUIRED
,
"user is required"
);
TSDBErrorMap
.
put
(
TSDBErrorNumbers
.
ERROR_PASSWORD_IS_REQUIRED
,
"password is required"
);
TSDBErrorMap
.
put
(
TSDBErrorNumbers
.
ERROR_INVALID_JSON_FORMAT
,
"invalid json format"
);
TSDBErrorMap
.
put
(
TSDBErrorNumbers
.
ERROR_UNKNOWN
,
"unknown error"
);
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java
浏览文件 @
84afe48a
...
...
@@ -31,6 +31,7 @@ public class TSDBErrorNumbers {
public
static
final
int
ERROR_RESTFul_Client_IOException
=
0x2318
;
public
static
final
int
ERROR_USER_IS_REQUIRED
=
0x2319
;
// user is required
public
static
final
int
ERROR_PASSWORD_IS_REQUIRED
=
0x231a
;
// password is required
public
static
final
int
ERROR_INVALID_JSON_FORMAT
=
0x231b
;
public
static
final
int
ERROR_UNKNOWN
=
0x2350
;
//unknown error
...
...
@@ -72,6 +73,7 @@ public class TSDBErrorNumbers {
errorNumbers
.
add
(
ERROR_RESTFul_Client_IOException
);
errorNumbers
.
add
(
ERROR_USER_IS_REQUIRED
);
errorNumbers
.
add
(
ERROR_PASSWORD_IS_REQUIRED
);
errorNumbers
.
add
(
ERROR_INVALID_JSON_FORMAT
);
errorNumbers
.
add
(
ERROR_RESTFul_Client_Protocol_Exception
);
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java
浏览文件 @
84afe48a
...
...
@@ -49,24 +49,19 @@ public class TSDBJNIConnector {
for
(
String
key
:
props
.
stringPropertyNames
())
{
configJSON
.
put
(
key
,
props
.
getProperty
(
key
));
}
int
ret
=
setConfigImp
(
configJSON
.
toJSONString
());
if
(
ret
==
-
1
)
{
throw
TSDBError
.
createSQLWarning
(
"failed to set config, invalid json format: "
+
configJSON
.
toJSONString
());
}
setConfigImp
(
configJSON
.
toJSONString
());
String
configDir
=
props
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_CONFIG_DIR
);
initImp
(
configDir
);
initImp
(
props
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_CONFIG_DIR
,
null
));
String
locale
=
props
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_LOCALE
);
String
charset
=
props
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_CHARSET
);
String
timezone
=
props
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_TIME_ZONE
);
if
(
setOptions
(
0
,
locale
)
<
0
)
{
throw
TSDBError
.
createSQLWarning
(
"Failed to set locale: "
+
locale
+
". System default will be used."
);
}
String
charset
=
props
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_CHARSET
);
if
(
setOptions
(
1
,
charset
)
<
0
)
{
throw
TSDBError
.
createSQLWarning
(
"Failed to set charset: "
+
charset
+
". System default will be used."
);
}
String
timezone
=
props
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_TIME_ZONE
);
if
(
setOptions
(
2
,
timezone
)
<
0
)
{
throw
TSDBError
.
createSQLWarning
(
"Failed to set timezone: "
+
timezone
+
". System default will be used."
);
}
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SetConfigurationInJNITest.java
浏览文件 @
84afe48a
...
...
@@ -53,4 +53,5 @@ public class SetConfigurationInJNITest {
e
.
printStackTrace
();
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录