提交 b76b4527 编写于 作者: Z zyyang

change

上级 ea4f3c9f
...@@ -29,6 +29,7 @@ public class StableTest { ...@@ -29,6 +29,7 @@ public class StableTest {
properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/", properties); connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/", properties);
Statement statement = connection.createStatement(); Statement statement = connection.createStatement();
statement.execute("drop database if exists " + dbName);
statement.execute("create database if not exists " + dbName); statement.execute("create database if not exists " + dbName);
statement.execute("use " + dbName); statement.execute("use " + dbName);
statement.close(); statement.close();
......
package com.taosdata.jdbc; package com.taosdata.jdbc;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
...@@ -67,106 +68,35 @@ public class StatementTest { ...@@ -67,106 +68,35 @@ public class StatementTest {
@Test @Test
public void testUnsupport() { public void testUnsupport() {
TSDBStatement tsdbStatement = (TSDBStatement) statement;
try { try {
tsdbStatement.unwrap(null); Assert.assertNotNull(statement.unwrap(TSDBStatement.class));
} catch (SQLException e) { Assert.assertTrue(statement.isWrapperFor(TSDBStatement.class));
}
try { statement.getMaxFieldSize();
tsdbStatement.isWrapperFor(null); statement.setMaxFieldSize(0);
} catch (SQLException e) { statement.setEscapeProcessing(true);
} statement.cancel();
try { statement.getWarnings();
tsdbStatement.getMaxFieldSize(); statement.clearWarnings();
} catch (SQLException e) { statement.setCursorName(null);
} statement.getMoreResults();
try { statement.setFetchDirection(0);
tsdbStatement.setMaxFieldSize(0); statement.getFetchDirection();
} catch (SQLException e) { statement.getResultSetConcurrency();
} statement.getResultSetType();
try { statement.getConnection();
tsdbStatement.setEscapeProcessing(true); statement.getMoreResults();
} catch (SQLException e) { statement.getGeneratedKeys();
} statement.executeUpdate(null, 0);
try { statement.executeUpdate(null, new int[]{0});
tsdbStatement.cancel(); statement.executeUpdate(null, new String[]{"str1", "str2"});
} catch (SQLException e) { statement.getResultSetHoldability();
} statement.setPoolable(true);
try { statement.isPoolable();
tsdbStatement.getWarnings(); statement.closeOnCompletion();
} catch (SQLException e) { statement.isCloseOnCompletion();
}
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) { } catch (SQLException e) {
e.printStackTrace();
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册