change
This commit is contained in:
parent
152b7f00ce
commit
71543cf085
|
@ -1,6 +1,7 @@
|
||||||
package com.taosdata.example.jdbcTemplate.dao;
|
package com.taosdata.example.jdbcTemplate.dao;
|
||||||
|
|
||||||
import com.taosdata.example.jdbcTemplate.domain.Weather;
|
import com.taosdata.example.jdbcTemplate.domain.Weather;
|
||||||
|
import com.taosdata.example.jdbcTemplate.dao.WeatherDao;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
|
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
|
|
@ -28,7 +28,6 @@ public class BatcherInsertTest {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ExecuteAsStatement executor;
|
private ExecuteAsStatement executor;
|
||||||
|
|
||||||
private static final String dbname = "jdbc_template_test";
|
|
||||||
private static final int numOfRecordsPerTable = 1000;
|
private static final int numOfRecordsPerTable = 1000;
|
||||||
private static long ts = 1496732686000l;
|
private static long ts = 1496732686000l;
|
||||||
private static Random random = new Random(System.currentTimeMillis());
|
private static Random random = new Random(System.currentTimeMillis());
|
||||||
|
@ -36,13 +35,13 @@ public class BatcherInsertTest {
|
||||||
@Before
|
@Before
|
||||||
public void before() {
|
public void before() {
|
||||||
// drop database
|
// drop database
|
||||||
executor.doExecute("drop database if exists " + dbname);
|
executor.doExecute("drop database if exists test");
|
||||||
// create database
|
// create database
|
||||||
executor.doExecute("create database if not exists " + dbname);
|
executor.doExecute("create database if not exists test");
|
||||||
//use database
|
//use database
|
||||||
executor.doExecute("use " + dbname);
|
executor.doExecute("use test");
|
||||||
// create table
|
// create table
|
||||||
executor.doExecute("create table if not exists weather (ts timestamp, temperature int, humidity float)");
|
executor.doExecute("create table if not exists test.weather (ts timestamp, temperature int, humidity float)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue