|
|
|
@ -98,7 +98,7 @@ public class JdbcDemoController {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
//@RequestMapping("/api/list")
|
|
|
|
@RequestMapping("/api/list")
|
|
|
|
public ResponseDto queryList() {
|
|
|
|
public ResponseDto queryList() {
|
|
|
|
// 自定义一个线程池,内部包含8个线程
|
|
|
|
// 自定义一个线程池,内部包含8个线程
|
|
|
|
ExecutorService customPool = Executors.newFixedThreadPool(2);
|
|
|
|
ExecutorService customPool = Executors.newFixedThreadPool(2);
|
|
|
|
@ -107,7 +107,7 @@ public class JdbcDemoController {
|
|
|
|
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
|
|
|
|
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
|
|
|
|
String sql = "select * from temperature where id = ?";
|
|
|
|
String sql = "select * from temperature where id = ?";
|
|
|
|
List<Object> jdbcParamValues = new ArrayList<>();
|
|
|
|
List<Object> jdbcParamValues = new ArrayList<>();
|
|
|
|
for (int i = 2336115; i < 2339088; i++) {
|
|
|
|
for (int i = 2371364; i < 2370470; i++) {
|
|
|
|
jdbcParamValues.add(i + 1);
|
|
|
|
jdbcParamValues.add(i + 1);
|
|
|
|
Gson gson = new Gson();
|
|
|
|
Gson gson = new Gson();
|
|
|
|
ResponseDto responseDto = JdbcUtil.executeSql(ds, sql, jdbcParamValues);
|
|
|
|
ResponseDto responseDto = JdbcUtil.executeSql(ds, sql, jdbcParamValues);
|
|
|
|
|