|
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
|
|
+import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.sql.DataSource;
|
|
@@ -66,8 +67,8 @@ public class KingBase2GBaseService {
|
|
|
log.error("目标数据库中不存在对应的数据库表【{}】,请检查", tableName);
|
|
|
throw new IllegalArgumentException("目标数据库中不存在对应的数据库表【{}】,请检查", e);
|
|
|
}
|
|
|
- JdbcTemplate thisJdbc = new JdbcTemplate(thisDatasource);
|
|
|
- JdbcTemplate otherJdbc = new JdbcTemplate(otherDataSource);
|
|
|
+ NamedParameterJdbcTemplate thisJdbc = new NamedParameterJdbcTemplate(thisDatasource);
|
|
|
+ NamedParameterJdbcTemplate otherJdbc = new NamedParameterJdbcTemplate(otherDataSource);
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> data = thisJdbc.query("select * from " + tableName, new UpperMapRowMapper());
|