ruanwenjun commented on a change in pull request #6500:
URL: https://github.com/apache/dolphinscheduler/pull/6500#discussion_r744260833



##########
File path: 
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/server/StandaloneServer.java
##########
@@ -88,25 +76,9 @@ private static void startRegistry() throws Exception {
         System.setProperty("registry.servers", server.getConnectString());
     }
 
-    private static void startDatabase() throws IOException, SQLException {
-        final Path temp = Files.createTempDirectory("dolphinscheduler_");
-        LOGGER.info("H2 database directory: {}", temp);
-        System.setProperty(
-                SPRING_DATASOURCE_DRIVER_CLASS_NAME,
-                org.h2.Driver.class.getName()
-        );
-        System.setProperty(
-                SPRING_DATASOURCE_URL,
-                
String.format("jdbc:h2:tcp://localhost/%s;MODE=MySQL;DATABASE_TO_LOWER=true", 
temp.toAbsolutePath())
-        );
-        System.setProperty(SPRING_DATASOURCE_USERNAME, "sa");
-        System.setProperty(SPRING_DATASOURCE_PASSWORD, "");
-
-        Server.createTcpServer("-ifNotExists", "-tcpDaemon").start();
-
-        final DataSource ds = ConnectionFactory.getInstance().getDataSource();
-        final ScriptRunner runner = new ScriptRunner(ds.getConnection(), true, 
true);
-        runner.runScript(new FileReader("sql/dolphinscheduler_h2.sql"));
+    private static void startDatabase() {
+        System.setProperty("spring.datasource.sql.schema", 
"file:./sql/dolphinscheduler_h2.sql");

Review comment:
       Yes, this method is not needed, I have removed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to