From 27db778ba3b656c02dbeb54d2fe9611a5e9c5e7c Mon Sep 17 00:00:00 2001 From: zyyang Date: Thu, 21 Jan 2021 19:39:21 +0800 Subject: [PATCH] change --- .../test/java/com/taosdata/jdbc/ImportTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/ImportTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/ImportTest.java index f338ba2b0a..d8a4545b53 100644 --- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/ImportTest.java +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/ImportTest.java @@ -16,8 +16,8 @@ public class ImportTest { String host = "127.0.0.1"; private static long ts; - @Before - public void createDatabase() { + @BeforeClass + public void before() { try { Class.forName("com.taosdata.jdbc.TSDBDriver"); Properties properties = new Properties(); @@ -27,13 +27,13 @@ public class ImportTest { connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/", properties); Statement stmt = connection.createStatement(); - stmt.executeUpdate("drop database if exists " + dbName); - stmt.executeUpdate("create database if not exists " + dbName); - stmt.executeUpdate("create table if not exists " + dbName + "." + tName + " (ts timestamp, k int, v int)"); - ts = System.currentTimeMillis(); + stmt.execute("create database if not exists " + dbName); + stmt.execute("create table if not exists " + dbName + "." + tName + " (ts timestamp, k int, v int)"); stmt.close(); + + ts = System.currentTimeMillis(); } catch (ClassNotFoundException e) { - return; + e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } @@ -99,7 +99,7 @@ public class ImportTest { Assert.assertEquals(100, select()); } - @After + @AfterClass public void close() { try { if (connection != null) { -- GitLab