Преглед на файлове

可以通过接口生成表空间并划分表分区

zoro преди 1 година
родител
ревизия
c8d9746957
променени са 2 файла, в които са добавени 40 реда и са изтрити 41 реда
  1. 38 38
      src/main/java/com/example/sqlrun/schedule/TestSchedule.java
  2. 2 3
      src/main/resources/application.yaml

+ 38 - 38
src/main/java/com/example/sqlrun/schedule/TestSchedule.java

@@ -1,38 +1,38 @@
-package com.example.sqlrun.schedule;
-
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-@Component
-public class TestSchedule {
-    @Resource(name = "statement")
-    private Statement statement;
-
-
-    public void doSql() throws SQLException {
-        String sql = "select * from  BAYONET_DYNAMIC.GPSINFO_HISTORY where gpstime >= to_date('2023-10-20 00:00:00','yyyy-MM-dd hh24:mi:ss')";
-        statement.execute(sql);
-        ResultSet resultSet = statement.getResultSet();
-        ResultSetMetaData metaData = resultSet.getMetaData();
-        ArrayList<Map<String, Object>> list = new ArrayList<>();
-        while (resultSet.next()) {
-            Map<String, Object> dataMap = new HashMap<>();
-            for (int i = 1; i <= metaData.getColumnCount(); i++) {
-                dataMap.put(metaData.getColumnLabel(i), resultSet.getObject(i));
-            }
-            list.add(dataMap);
-        }
-        for (Map<String, Object> map : list) {
-            System.out.println(map);
-        }
-    }
-}
+//package com.example.sqlrun.schedule;
+//
+//import org.springframework.stereotype.Component;
+//
+//import javax.annotation.PostConstruct;
+//import javax.annotation.Resource;
+//import java.sql.ResultSet;
+//import java.sql.ResultSetMetaData;
+//import java.sql.SQLException;
+//import java.sql.Statement;
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//@Component
+//public class TestSchedule {
+//    @Resource(name = "statement")
+//    private Statement statement;
+//
+//
+//    public void doSql() throws SQLException {
+//        String sql = "select * from  BAYONET_DYNAMIC.GPSINFO_HISTORY where gpstime >= to_date('2023-10-20 00:00:00','yyyy-MM-dd hh24:mi:ss')";
+//        statement.execute(sql);
+//        ResultSet resultSet = statement.getResultSet();
+//        ResultSetMetaData metaData = resultSet.getMetaData();
+//        ArrayList<Map<String, Object>> list = new ArrayList<>();
+//        while (resultSet.next()) {
+//            Map<String, Object> dataMap = new HashMap<>();
+//            for (int i = 1; i <= metaData.getColumnCount(); i++) {
+//                dataMap.put(metaData.getColumnLabel(i), resultSet.getObject(i));
+//            }
+//            list.add(dataMap);
+//        }
+//        for (Map<String, Object> map : list) {
+//            System.out.println(map);
+//        }
+//    }
+//}

+ 2 - 3
src/main/resources/application.yaml

@@ -2,13 +2,12 @@ server:
   port: 7070
 spring:
   datasource:
-    driver-class-name: dm.jdbc.driver.DmDriver
+    driver-class-name: oracle.jdbc.OracleDriver
     hikari:
       idle-timeout: 30000
       maximum-pool-size: 150
     password: HjYagBWz0iZP094X
-    url: jdbc:dm://10.114.4.56:52366
-#    url: jdbc:oracle:thin:@//10.114.4.56/shhwdb
+    url: jdbc:oracle:thin:@//127.0.0.1:1521/orcl
     username: SYSDBA
   freemarker:
     check-template-location: false