Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cbc4b2bb
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看板
提交
cbc4b2bb
编写于
8月 23, 2021
作者:
Z
zyyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5949]<test>: add setConfig test case and change jdbc's version
上级
bc530df2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
65 addition
and
17 deletion
+65
-17
cmake/install.inc
cmake/install.inc
+1
-1
src/connector/jdbc/CMakeLists.txt
src/connector/jdbc/CMakeLists.txt
+1
-1
src/connector/jdbc/deploy-pom.xml
src/connector/jdbc/deploy-pom.xml
+1
-1
src/connector/jdbc/pom.xml
src/connector/jdbc/pom.xml
+1
-1
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java
...ctor/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java
+0
-3
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java
...dbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java
+8
-8
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SetConfigurationInJNITest.java
...est/java/com/taosdata/jdbc/SetConfigurationInJNITest.java
+53
-2
未找到文件。
cmake/install.inc
浏览文件 @
cbc4b2bb
...
@@ -32,7 +32,7 @@ ELSEIF (TD_WINDOWS)
...
@@ -32,7 +32,7 @@ ELSEIF (TD_WINDOWS)
#INSTALL(TARGETS taos RUNTIME DESTINATION driver)
#INSTALL(TARGETS taos RUNTIME DESTINATION driver)
#INSTALL(TARGETS shell RUNTIME DESTINATION .)
#INSTALL(TARGETS shell RUNTIME DESTINATION .)
IF
(
TD_MVN_INSTALLED
)
IF
(
TD_MVN_INSTALLED
)
INSTALL
(
FILES
$
{
LIBRARY_OUTPUT_PATH
}
/
taos
-
jdbcdriver
-
2.0.3
4
-
dist
.
jar
DESTINATION
connector
/
jdbc
)
INSTALL
(
FILES
$
{
LIBRARY_OUTPUT_PATH
}
/
taos
-
jdbcdriver
-
2.0.3
5
-
dist
.
jar
DESTINATION
connector
/
jdbc
)
ENDIF
()
ENDIF
()
ELSEIF
(
TD_DARWIN
)
ELSEIF
(
TD_DARWIN
)
SET
(
TD_MAKE_INSTALL_SH
"${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh"
)
SET
(
TD_MAKE_INSTALL_SH
"${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh"
)
...
...
src/connector/jdbc/CMakeLists.txt
浏览文件 @
cbc4b2bb
...
@@ -8,7 +8,7 @@ IF (TD_MVN_INSTALLED)
...
@@ -8,7 +8,7 @@ IF (TD_MVN_INSTALLED)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
JDBC_CMD_NAME
}
ADD_CUSTOM_COMMAND
(
OUTPUT
${
JDBC_CMD_NAME
}
POST_BUILD
POST_BUILD
COMMAND mvn -Dmaven.test.skip=true install -f
${
CMAKE_CURRENT_SOURCE_DIR
}
/pom.xml
COMMAND mvn -Dmaven.test.skip=true install -f
${
CMAKE_CURRENT_SOURCE_DIR
}
/pom.xml
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_CURRENT_SOURCE_DIR
}
/target/taos-jdbcdriver-2.0.3
4
-dist.jar
${
LIBRARY_OUTPUT_PATH
}
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_CURRENT_SOURCE_DIR
}
/target/taos-jdbcdriver-2.0.3
5
-dist.jar
${
LIBRARY_OUTPUT_PATH
}
COMMAND mvn -Dmaven.test.skip=true clean -f
${
CMAKE_CURRENT_SOURCE_DIR
}
/pom.xml
COMMAND mvn -Dmaven.test.skip=true clean -f
${
CMAKE_CURRENT_SOURCE_DIR
}
/pom.xml
COMMENT
"build jdbc driver"
)
COMMENT
"build jdbc driver"
)
ADD_CUSTOM_TARGET
(
${
JDBC_TARGET_NAME
}
ALL WORKING_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
DEPENDS
${
JDBC_CMD_NAME
}
)
ADD_CUSTOM_TARGET
(
${
JDBC_TARGET_NAME
}
ALL WORKING_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
DEPENDS
${
JDBC_CMD_NAME
}
)
...
...
src/connector/jdbc/deploy-pom.xml
浏览文件 @
cbc4b2bb
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<groupId>
com.taosdata.jdbc
</groupId>
<groupId>
com.taosdata.jdbc
</groupId>
<artifactId>
taos-jdbcdriver
</artifactId>
<artifactId>
taos-jdbcdriver
</artifactId>
<version>
2.0.3
4
</version>
<version>
2.0.3
5
</version>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<name>
JDBCDriver
</name>
<name>
JDBCDriver
</name>
...
...
src/connector/jdbc/pom.xml
浏览文件 @
cbc4b2bb
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.taosdata.jdbc
</groupId>
<groupId>
com.taosdata.jdbc
</groupId>
<artifactId>
taos-jdbcdriver
</artifactId>
<artifactId>
taos-jdbcdriver
</artifactId>
<version>
2.0.3
4
</version>
<version>
2.0.3
5
</version>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<name>
JDBCDriver
</name>
<name>
JDBCDriver
</name>
<url>
https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc
</url>
<url>
https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc
</url>
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java
浏览文件 @
cbc4b2bb
...
@@ -118,9 +118,6 @@ public class TSDBDriver extends AbstractDriver {
...
@@ -118,9 +118,6 @@ public class TSDBDriver extends AbstractDriver {
}
}
public
Connection
connect
(
String
url
,
Properties
info
)
throws
SQLException
{
public
Connection
connect
(
String
url
,
Properties
info
)
throws
SQLException
{
if
(
url
==
null
)
throw
TSDBError
.
createSQLException
(
TSDBErrorNumbers
.
ERROR_URL_NOT_SET
);
if
(!
acceptsURL
(
url
))
if
(!
acceptsURL
(
url
))
return
null
;
return
null
;
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java
浏览文件 @
cbc4b2bb
...
@@ -38,14 +38,6 @@ public class TSDBJNIConnector {
...
@@ -38,14 +38,6 @@ public class TSDBJNIConnector {
System
.
loadLibrary
(
"taos"
);
System
.
loadLibrary
(
"taos"
);
}
}
public
boolean
isClosed
()
{
return
this
.
taos
==
TSDBConstants
.
JNI_NULL_POINTER
;
}
public
boolean
isResultsetClosed
()
{
return
this
.
isResultsetClosed
;
}
public
static
void
init
(
String
configDir
,
String
locale
,
String
charset
,
String
timezone
)
throws
SQLWarning
{
public
static
void
init
(
String
configDir
,
String
locale
,
String
charset
,
String
timezone
)
throws
SQLWarning
{
synchronized
(
isInitialized
)
{
synchronized
(
isInitialized
)
{
if
(!
isInitialized
)
{
if
(!
isInitialized
)
{
...
@@ -159,6 +151,14 @@ public class TSDBJNIConnector {
...
@@ -159,6 +151,14 @@ public class TSDBJNIConnector {
private
native
long
isUpdateQueryImp
(
long
connection
,
long
pSql
);
private
native
long
isUpdateQueryImp
(
long
connection
,
long
pSql
);
public
boolean
isClosed
()
{
return
this
.
taos
==
TSDBConstants
.
JNI_NULL_POINTER
;
}
public
boolean
isResultsetClosed
()
{
return
this
.
isResultsetClosed
;
}
/**
/**
* Free result set operation from C to release result set pointer by JNI
* Free result set operation from C to release result set pointer by JNI
*/
*/
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SetConfigurationInJNITest.java
浏览文件 @
cbc4b2bb
...
@@ -2,10 +2,61 @@ package com.taosdata.jdbc;
...
@@ -2,10 +2,61 @@ package com.taosdata.jdbc;
import
org.junit.Test
;
import
org.junit.Test
;
import
java.sql.SQLException
;
import
java.util.Arrays
;
import
static
org
.
junit
.
Assert
.*;
public
class
SetConfigurationInJNITest
{
public
class
SetConfigurationInJNITest
{
private
String
host
=
"127.0.0.1"
;
private
String
dbname
=
"test_jni"
;
private
long
maxSQLLength
=
1024000
;
private
String
debugFlagJSON
=
"{ \"debugFlag\": 135}"
;
private
String
maxSqlLengthJSON
=
"{ \"maxSQLLength\": "
+
maxSQLLength
+
"}"
;
@Test
public
void
testDebugFlag
()
{
try
{
TSDBJNIConnector
.
initImp
(
null
);
TSDBJNIConnector
.
setOptions
(
0
,
null
);
TSDBJNIConnector
.
setOptions
(
1
,
null
);
TSDBJNIConnector
.
setOptions
(
2
,
null
);
String
tsCharset
=
TSDBJNIConnector
.
getTsCharset
();
System
.
out
.
println
(
tsCharset
);
TSDBJNIConnector
jniConnector
=
new
TSDBJNIConnector
();
boolean
connected
=
jniConnector
.
connect
(
host
,
0
,
null
,
"root"
,
"taosdata"
);
assertTrue
(
connected
);
String
[]
setupSqls
=
{
"drop database if exists "
+
dbname
,
"create database if not exists "
+
dbname
,
"use "
+
dbname
,
"create table weather(ts timestamp, f1 int) tags(loc nchar(10))"
,
"insert into t1 using weather tags('beijing') values(now, 1)"
,
"drop database if exists "
+
dbname
};
Arrays
.
asList
(
setupSqls
).
forEach
(
sql
->
{
try
{
long
setupSql
=
jniConnector
.
executeQuery
(
sql
);
if
(
jniConnector
.
isUpdateQuery
(
setupSql
))
{
jniConnector
.
freeResultSet
(
setupSql
);
}
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
});
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
@Test
@Test
public
void
test
()
{
public
void
test
MaxSQLLength
()
{
}
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录