Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
25f54f60
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
提交
25f54f60
编写于
6月 12, 2020
作者:
S
Shuaiqiang Chang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tests
上级
35c92cc8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
860 addition
and
2 deletion
+860
-2
src/connector/jdbc/src/test/java/com/taosdata/jdbc/PreparedStatementTest.java
...rc/test/java/com/taosdata/jdbc/PreparedStatementTest.java
+161
-0
src/connector/jdbc/src/test/java/com/taosdata/jdbc/ResultSetTest.java
...r/jdbc/src/test/java/com/taosdata/jdbc/ResultSetTest.java
+695
-2
src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java
...r/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java
+4
-0
未找到文件。
src/connector/jdbc/src/test/java/com/taosdata/jdbc/PreparedStatementTest.java
0 → 100644
浏览文件 @
25f54f60
package
com.taosdata.jdbc
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
java.sql.*
;
import
java.util.Properties
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
public
class
PreparedStatementTest
{
static
Connection
connection
=
null
;
static
PreparedStatement
statement
=
null
;
static
String
dbName
=
"test"
;
static
String
tName
=
"t0"
;
static
String
host
=
"localhost"
;
static
ResultSet
resSet
=
null
;
@BeforeClass
public
static
void
createConnection
()
throws
SQLException
{
try
{
Class
.
forName
(
"com.taosdata.jdbc.TSDBDriver"
);
}
catch
(
ClassNotFoundException
e
)
{
return
;
}
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_HOST
,
host
);
connection
=
DriverManager
.
getConnection
(
"jdbc:TAOS://"
+
host
+
":0/"
+
"?user=root&password=taosdata"
,
properties
);
String
sql
=
"drop database if exists "
+
dbName
;
statement
=
(
TSDBPreparedStatement
)
connection
.
prepareStatement
(
sql
);
}
@Test
public
void
createTableAndQuery
()
throws
SQLException
{
long
ts
=
System
.
currentTimeMillis
();
statement
.
executeUpdate
(
"create database if not exists "
+
dbName
);
statement
.
executeUpdate
(
"create table if not exists "
+
dbName
+
"."
+
tName
+
"(ts timestamp, k1 int)"
);
statement
.
executeUpdate
(
"insert into "
+
dbName
+
"."
+
tName
+
" values ("
+
ts
+
", 1)"
);
PreparedStatement
selectStatement
=
connection
.
prepareStatement
(
"select * from "
+
dbName
+
"."
+
tName
);
ResultSet
resultSet
=
selectStatement
.
executeQuery
();
assertTrue
(
null
!=
resultSet
);
boolean
isClosed
=
statement
.
isClosed
();
assertEquals
(
false
,
isClosed
);
}
@Test
public
void
testUnsupport
()
{
// if(null == resSet) {
// return;
// }
TSDBPreparedStatement
tsdbStatement
=
(
TSDBPreparedStatement
)
statement
;
try
{
tsdbStatement
.
unwrap
(
null
);
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
isWrapperFor
(
null
);
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getMaxFieldSize
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
setMaxFieldSize
(
0
);
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
setEscapeProcessing
(
true
);
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
cancel
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getWarnings
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
clearWarnings
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
setCursorName
(
null
);
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getMoreResults
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
setFetchDirection
(
0
);
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getFetchDirection
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getResultSetConcurrency
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getResultSetType
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getConnection
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getMoreResults
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getGeneratedKeys
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
executeUpdate
(
null
,
0
);
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
executeUpdate
(
null
,
new
int
[]{
0
});
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
executeUpdate
(
null
,
new
String
[]{
"str1"
,
"str2"
});
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
getResultSetHoldability
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
setPoolable
(
true
);
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
isPoolable
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
closeOnCompletion
();
}
catch
(
SQLException
e
)
{
}
try
{
tsdbStatement
.
isCloseOnCompletion
();
}
catch
(
SQLException
e
)
{
}
}
}
src/connector/jdbc/src/test/java/com/taosdata/jdbc/ResultSetTest.java
浏览文件 @
25f54f60
...
...
@@ -4,10 +4,14 @@ import org.junit.AfterClass;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
javax.sql.rowset.serial.SerialBlob
;
import
javax.sql.rowset.serial.SerialClob
;
import
java.sql.*
;
import
java.util.HashMap
;
import
java.util.Properties
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
public
class
ResultSetTest
{
static
Connection
connection
=
null
;
...
...
@@ -53,7 +57,6 @@ public class ResultSetTest {
sql
=
"insert into "
+
dbName
+
"."
+
tName
+
" values ("
+
ts
+
","
+
v1
+
","
+
v2
+
","
+
v3
+
","
+
v4
+
",\""
+
v5
+
"\","
+
v6
+
","
+
v7
+
",\""
+
v8
+
"\")"
;
// System.out.println(sql);
try
{
statement
.
executeUpdate
(
sql
);
...
...
@@ -100,12 +103,702 @@ public class ResultSetTest {
resSet
.
getObject
(
6
);
resSet
.
getObject
(
"k8"
);
}
resSet
.
close
();
if
(!
resSet
.
isClosed
())
{
resSet
.
close
();
}
}
catch
(
SQLException
e
)
{
assert
false
:
"insert error "
+
e
.
getMessage
();
}
}
@Test
public
void
testUnsupport
()
throws
SQLException
{
statement
.
executeQuery
(
"show databases"
);
resSet
=
statement
.
getResultSet
();
try
{
resSet
.
unwrap
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
isWrapperFor
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getAsciiStream
(
0
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getUnicodeStream
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getBinaryStream
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getAsciiStream
(
""
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getUnicodeStream
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getBinaryStream
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getWarnings
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
clearWarnings
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getCursorName
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getCharacterStream
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getCharacterStream
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
isBeforeFirst
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
isAfterLast
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
isFirst
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
isLast
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
beforeFirst
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
afterLast
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
first
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
last
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getRow
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
absolute
(
1
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
relative
(
1
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
previous
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
setFetchDirection
(
0
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getFetchDirection
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
setFetchSize
(
0
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getFetchSize
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getConcurrency
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
rowUpdated
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
rowInserted
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
rowDeleted
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateNull
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBoolean
(
0
,
true
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateByte
(
0
,
(
byte
)
2
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateShort
(
0
,
(
short
)
1
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateInt
(
0
,
0
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateLong
(
0
,
0
l
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateFloat
(
0
,
3.14f
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateDouble
(
0
,
3.1415
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBigDecimal
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateString
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBytes
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateDate
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateTime
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateTimestamp
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateAsciiStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBinaryStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateObject
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateObject
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateNull
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBoolean
(
""
,
false
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateByte
(
""
,
(
byte
)
1
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateShort
(
""
,
(
short
)
1
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateInt
(
""
,
0
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateLong
(
""
,
0
l
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateFloat
(
""
,
3.14f
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateDouble
(
""
,
3.1415
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBigDecimal
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateString
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBytes
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateDate
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateTime
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateTimestamp
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateAsciiStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBinaryStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateObject
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateObject
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
insertRow
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateRow
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
deleteRow
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
refreshRow
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
cancelRowUpdates
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
moveToInsertRow
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
moveToCurrentRow
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getStatement
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getObject
(
0
,
new
HashMap
<>());
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getRef
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getBlob
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getClob
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getArray
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getObject
(
""
,
new
HashMap
<>());
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getRef
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getBlob
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getClob
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getArray
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getDate
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getDate
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getTime
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getTime
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getTimestamp
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getTimestamp
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getURL
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getURL
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateRef
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateRef
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBlob
(
0
,
new
SerialBlob
(
""
.
getBytes
(
"UTF8"
)));
}
catch
(
Exception
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBlob
(
""
,
new
SerialBlob
(
""
.
getBytes
(
"UTF8"
)));
}
catch
(
Exception
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateClob
(
""
,
new
SerialClob
(
""
.
toCharArray
()));
}
catch
(
Exception
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateClob
(
0
,
new
SerialClob
(
""
.
toCharArray
()));
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateArray
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateArray
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getRowId
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getRowId
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateRowId
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateRowId
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getHoldability
();
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateNString
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateNString
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getNClob
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getNClob
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getSQLXML
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getSQLXML
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateSQLXML
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateSQLXML
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getNCharacterStream
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
getNCharacterStream
(
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateNCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateNCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateAsciiStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBinaryStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateAsciiStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBinaryStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateNCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateNCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateAsciiStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBinaryStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateAsciiStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateBinaryStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
try
{
resSet
.
updateCharacterStream
(
null
,
null
);
}
catch
(
SQLException
e
)
{
assertTrue
(
e
.
getMessage
().
contains
(
"this operation is NOT supported currently!"
));
}
}
@Test
public
void
testBatch
()
throws
SQLException
{
String
[]
sqls
=
new
String
[]{
"insert into test.t0 values (1496732686001,2147483600,1496732687000,3.1415925,3.1415926\n"
+
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java
浏览文件 @
25f54f60
...
...
@@ -6,6 +6,7 @@ import org.junit.Test;
import
java.sql.*
;
import
java.util.Properties
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
public
class
StatementTest
{
...
...
@@ -43,6 +44,9 @@ public class StatementTest {
statement
.
executeQuery
(
"select * from "
+
dbName
+
"."
+
tName
);
ResultSet
resultSet
=
statement
.
getResultSet
();
assertTrue
(
null
!=
resultSet
);
boolean
isClosed
=
statement
.
isClosed
();
assertEquals
(
false
,
isClosed
);
}
@Test
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录