未验证 提交 09b58e7e 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

[TD-5259]<fix>: JDBC vulnerable packages. (#6858)

上级 80faa86c
...@@ -32,7 +32,7 @@ ELSEIF (TD_WINDOWS) ...@@ -32,7 +32,7 @@ ELSEIF (TD_WINDOWS)
#INSTALL(TARGETS taos RUNTIME DESTINATION driver) #INSTALL(TARGETS taos RUNTIME DESTINATION driver)
#INSTALL(TARGETS shell RUNTIME DESTINATION .) #INSTALL(TARGETS shell RUNTIME DESTINATION .)
IF (TD_MVN_INSTALLED) IF (TD_MVN_INSTALLED)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.32-dist.jar DESTINATION connector/jdbc) INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-*-dist.jar DESTINATION connector/jdbc)
ENDIF () ENDIF ()
ELSEIF (TD_DARWIN) ELSEIF (TD_DARWIN)
SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh")
......
...@@ -8,8 +8,8 @@ IF (TD_MVN_INSTALLED) ...@@ -8,8 +8,8 @@ IF (TD_MVN_INSTALLED)
ADD_CUSTOM_COMMAND(OUTPUT ${JDBC_CMD_NAME} ADD_CUSTOM_COMMAND(OUTPUT ${JDBC_CMD_NAME}
POST_BUILD POST_BUILD
COMMAND mvn -Dmaven.test.skip=true install -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml COMMAND mvn -Dmaven.test.skip=true install -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-2.0.32-dist.jar ${LIBRARY_OUTPUT_PATH} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-*-dist.jar ${LIBRARY_OUTPUT_PATH}
COMMAND mvn -Dmaven.test.skip=true clean -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml COMMAND mvn -Dmaven.test.skip=true clean -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMENT "build jdbc driver") COMMENT "build jdbc driver")
ADD_CUSTOM_TARGET(${JDBC_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${JDBC_CMD_NAME}) ADD_CUSTOM_TARGET(${JDBC_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${JDBC_CMD_NAME})
ENDIF () ENDIF ()
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.taosdata.jdbc</groupId> <groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId> <artifactId>taos-jdbcdriver</artifactId>
<version>2.0.32</version> <version>2.0.33</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>JDBCDriver</name> <name>JDBCDriver</name>
<url>https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc</url> <url>https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc</url>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.13</version> <version>4.13.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- for restful --> <!-- for restful -->
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<version>29.0-jre</version> <version>30.0-jre</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version> <version>4.13.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
......
...@@ -87,14 +87,14 @@ ...@@ -87,14 +87,14 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version> <version>4.13.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<version>29.0-jre</version> <version>30.0-jre</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.13</version> <version>4.13.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
......
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<groupId>com.taosdata.demo</groupId> <groupId>com.taosdata.demo</groupId>
<artifactId>connectionPools</artifactId> <artifactId>connectionPools</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
...@@ -46,9 +51,9 @@ ...@@ -46,9 +51,9 @@
</dependency> </dependency>
<!-- log4j --> <!-- log4j -->
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j-core</artifactId>
<version>1.2.17</version> <version>2.14.1</version>
</dependency> </dependency>
<!-- proxool --> <!-- proxool -->
<dependency> <dependency>
...@@ -108,4 +113,4 @@ ...@@ -108,4 +113,4 @@
</plugins> </plugins>
</build> </build>
</project> </project>
\ No newline at end of file
...@@ -5,7 +5,8 @@ import com.taosdata.example.pool.C3p0Builder; ...@@ -5,7 +5,8 @@ import com.taosdata.example.pool.C3p0Builder;
import com.taosdata.example.pool.DbcpBuilder; import com.taosdata.example.pool.DbcpBuilder;
import com.taosdata.example.pool.DruidPoolBuilder; import com.taosdata.example.pool.DruidPoolBuilder;
import com.taosdata.example.pool.HikariCpBuilder; import com.taosdata.example.pool.HikariCpBuilder;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.sql.Connection; import java.sql.Connection;
...@@ -17,7 +18,7 @@ import java.util.concurrent.TimeUnit; ...@@ -17,7 +18,7 @@ import java.util.concurrent.TimeUnit;
public class ConnectionPoolDemo { public class ConnectionPoolDemo {
private static Logger logger = Logger.getLogger(DruidPoolBuilder.class); private static Logger logger = LogManager.getLogger(DruidPoolBuilder.class);
private static final String dbName = "pool_test"; private static final String dbName = "pool_test";
private static String poolType = "hikari"; private static String poolType = "hikari";
......
package com.taosdata.example.common; package com.taosdata.example.common;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.sql.Connection; import java.sql.Connection;
...@@ -10,7 +11,7 @@ import java.util.Random; ...@@ -10,7 +11,7 @@ import java.util.Random;
public class InsertTask implements Runnable { public class InsertTask implements Runnable {
private final Random random = new Random(System.currentTimeMillis()); private final Random random = new Random(System.currentTimeMillis());
private static final Logger logger = Logger.getLogger(InsertTask.class); private static final Logger logger = LogManager.getLogger(InsertTask.class);
private final DataSource ds; private final DataSource ds;
private final String dbName; private final String dbName;
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>4.13.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.taosdata</groupId> <groupId>com.taosdata</groupId>
<artifactId>taosdemo</artifactId> <artifactId>taosdemo</artifactId>
<version>2.0</version> <version>2.0.1</version>
<name>taosdemo</name> <name>taosdemo</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<description>Demo project for TDengine</description> <description>Demo project for TDengine</description>
...@@ -81,20 +81,20 @@ ...@@ -81,20 +81,20 @@
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version> <version>8.0.16</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- log4j --> <!-- log4j -->
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j-core</artifactId>
<version>1.2.17</version> <version>2.14.1</version>
</dependency> </dependency>
<!-- junit --> <!-- junit -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>4.13.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- lombok --> <!-- lombok -->
......
...@@ -8,7 +8,8 @@ import com.taosdata.taosdemo.service.SqlExecuteTask; ...@@ -8,7 +8,8 @@ import com.taosdata.taosdemo.service.SqlExecuteTask;
import com.taosdata.taosdemo.service.SubTableService; import com.taosdata.taosdemo.service.SubTableService;
import com.taosdata.taosdemo.service.SuperTableService; import com.taosdata.taosdemo.service.SuperTableService;
import com.taosdata.taosdemo.service.data.SuperTableMetaGenerator; import com.taosdata.taosdemo.service.data.SuperTableMetaGenerator;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.io.IOException; import java.io.IOException;
...@@ -20,7 +21,7 @@ import java.util.Map; ...@@ -20,7 +21,7 @@ import java.util.Map;
public class TaosDemoApplication { public class TaosDemoApplication {
private static final Logger logger = Logger.getLogger(TaosDemoApplication.class); private static final Logger logger = LogManager.getLogger(TaosDemoApplication.class);
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
// 读配置参数 // 读配置参数
......
package com.taosdata.taosdemo.dao; package com.taosdata.taosdemo.dao;
import com.taosdata.taosdemo.utils.SqlSpeller; import com.taosdata.taosdemo.utils.SqlSpeller;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.Map; import java.util.Map;
public class DatabaseMapperImpl implements DatabaseMapper { public class DatabaseMapperImpl implements DatabaseMapper {
private static final Logger logger = Logger.getLogger(DatabaseMapperImpl.class); private static final Logger logger = LogManager.getLogger(DatabaseMapperImpl.class);
private final JdbcTemplate jdbcTemplate; private final JdbcTemplate jdbcTemplate;
......
...@@ -3,7 +3,8 @@ package com.taosdata.taosdemo.dao; ...@@ -3,7 +3,8 @@ package com.taosdata.taosdemo.dao;
import com.taosdata.taosdemo.domain.SubTableMeta; import com.taosdata.taosdemo.domain.SubTableMeta;
import com.taosdata.taosdemo.domain.SubTableValue; import com.taosdata.taosdemo.domain.SubTableValue;
import com.taosdata.taosdemo.utils.SqlSpeller; import com.taosdata.taosdemo.utils.SqlSpeller;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import javax.sql.DataSource; import javax.sql.DataSource;
...@@ -11,7 +12,7 @@ import java.util.List; ...@@ -11,7 +12,7 @@ import java.util.List;
public class SubTableMapperImpl implements SubTableMapper { public class SubTableMapperImpl implements SubTableMapper {
private static final Logger logger = Logger.getLogger(SubTableMapperImpl.class); private static final Logger logger = LogManager.getLogger(SubTableMapperImpl.class);
private final JdbcTemplate jdbcTemplate; private final JdbcTemplate jdbcTemplate;
public SubTableMapperImpl(DataSource dataSource) { public SubTableMapperImpl(DataSource dataSource) {
......
...@@ -2,13 +2,14 @@ package com.taosdata.taosdemo.dao; ...@@ -2,13 +2,14 @@ package com.taosdata.taosdemo.dao;
import com.taosdata.taosdemo.domain.SuperTableMeta; import com.taosdata.taosdemo.domain.SuperTableMeta;
import com.taosdata.taosdemo.utils.SqlSpeller; import com.taosdata.taosdemo.utils.SqlSpeller;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import javax.sql.DataSource; import javax.sql.DataSource;
public class SuperTableMapperImpl implements SuperTableMapper { public class SuperTableMapperImpl implements SuperTableMapper {
private static final Logger logger = Logger.getLogger(SuperTableMapperImpl.class); private static final Logger logger = LogManager.getLogger(SuperTableMapperImpl.class);
private JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
public SuperTableMapperImpl(DataSource dataSource) { public SuperTableMapperImpl(DataSource dataSource) {
......
...@@ -3,13 +3,14 @@ package com.taosdata.taosdemo.dao; ...@@ -3,13 +3,14 @@ package com.taosdata.taosdemo.dao;
import com.taosdata.taosdemo.domain.TableMeta; import com.taosdata.taosdemo.domain.TableMeta;
import com.taosdata.taosdemo.domain.TableValue; import com.taosdata.taosdemo.domain.TableValue;
import com.taosdata.taosdemo.utils.SqlSpeller; import com.taosdata.taosdemo.utils.SqlSpeller;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List; import java.util.List;
public class TableMapperImpl implements TableMapper { public class TableMapperImpl implements TableMapper {
private static final Logger logger = Logger.getLogger(TableMapperImpl.class); private static final Logger logger = LogManager.getLogger(TableMapperImpl.class);
private JdbcTemplate template; private JdbcTemplate template;
@Override @Override
......
...@@ -8,7 +8,8 @@ import com.taosdata.taosdemo.domain.SubTableValue; ...@@ -8,7 +8,8 @@ import com.taosdata.taosdemo.domain.SubTableValue;
import com.taosdata.taosdemo.domain.SuperTableMeta; import com.taosdata.taosdemo.domain.SuperTableMeta;
import com.taosdata.taosdemo.service.data.SubTableMetaGenerator; import com.taosdata.taosdemo.service.data.SubTableMetaGenerator;
import com.taosdata.taosdemo.service.data.SubTableValueGenerator; import com.taosdata.taosdemo.service.data.SubTableValueGenerator;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -20,7 +21,7 @@ import java.util.stream.IntStream; ...@@ -20,7 +21,7 @@ import java.util.stream.IntStream;
public class SubTableService extends AbstractService { public class SubTableService extends AbstractService {
private SubTableMapper mapper; private SubTableMapper mapper;
private static final Logger logger = Logger.getLogger(SubTableService.class); private static final Logger logger = LogManager.getLogger(SubTableService.class);
public SubTableService(DataSource datasource) { public SubTableService(DataSource datasource) {
this.mapper = new SubTableMapperImpl(datasource); this.mapper = new SubTableMapperImpl(datasource);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册