-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMain.java
More file actions
34 lines (30 loc) · 931 Bytes
/
Main.java
File metadata and controls
34 lines (30 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.datatrans;
import com.datatrans.ui.DataTransferGUI;
/**
* 数据库表数据迁移工具主入口类
* 支持命令行模式和图形界面模式
*/
public class Main {
public static void main(String[] args) {
// 如果没有参数,则启动GUI
if (args.length == 0) {
try {
// 启动GUI
DataTransferGUI.main(args);
return;
} catch (Exception e) {
System.err.println("启动GUI失败: " + e.getMessage());
e.printStackTrace();
System.exit(1);
}
}
// 如果有参数,则以命令行模式运行
try {
App.main(args);
} catch (Exception e) {
System.err.println("命令行模式运行失败: " + e.getMessage());
e.printStackTrace();
System.exit(1);
}
}
}