提交 05cf7afc 编写于 作者: Z zyyang

change

上级 b5c1f002
......@@ -68,6 +68,8 @@
<groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId>
<version>2.0.15</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/taos-jdbcdriver-2.0.15.jar</systemPath>
</dependency>
<!-- fastjson -->
<dependency>
......@@ -75,12 +77,12 @@
<artifactId>fastjson</artifactId>
<version>1.2.75</version>
</dependency>
<!-- mysql -->
<!-- mysql: just for test -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version>
<scope>test</scope>
</dependency>
<!-- log4j -->
<dependency>
......@@ -111,6 +113,7 @@
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.jar</include>
</includes>
<filtering>true</filtering>
</resource>
......
......@@ -25,8 +25,8 @@ public class TaosDemoApplication {
// 读配置参数
JdbcTaosdemoConfig config = new JdbcTaosdemoConfig(args);
boolean isHelp = Arrays.asList(args).contains("--help");
// if (isHelp || config.host == null || config.host.isEmpty()) {
if (isHelp) {
if (isHelp || config.host == null || config.host.isEmpty()) {
// if (isHelp) {
JdbcTaosdemoConfig.printHelp();
System.exit(0);
}
......
......@@ -23,10 +23,19 @@ public class DataSourceFactory {
properties.load(is);
HikariConfig config = new HikariConfig();
if (properties.containsKey("jdbc.driver"))
if (properties.containsKey("jdbc.driver")) {
// String driverName = properties.getProperty("jdbc.driver");
// System.out.println(">>> load driver : " + driverName);
// try {
// Class.forName(driverName);
// } catch (ClassNotFoundException e) {
// e.printStackTrace();
// }
config.setDriverClassName(properties.getProperty("jdbc.driver"));
else
} else {
config.setDriverClassName("com.taosdata.jdbc.TSDBDriver");
}
if ("com.taosdata.jdbc.rs.RestfulDriver".equalsIgnoreCase(properties.getProperty("jdbc.driver")))
config.setJdbcUrl("jdbc:TAOS-RS://" + host + ":6041/?charset=UTF-8&locale=en_US.UTF-8&timezone=UTC-8");
else
......
......@@ -14,7 +14,8 @@ spring.datasource.password=taosdata
#spring.datasource.hikari.minimum-idle=1
#spring.datasource.hikari.max-lifetime=0
#logging.level.com.taosdata.taosdemo.dao=error
jdbc.driver=com.taosdata.jdbc.TSDBDriver
jdbc.driver=com.taosdata.jdbc.rs.RestfulDriver
hikari.maximum-pool-size=500
hikari.minimum-idle=100
hikari.max-lifetime=0
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册