diff --git a/GDMS.iml b/GDMS.iml
index 0ccb429..4bde68d 100644
--- a/GDMS.iml
+++ b/GDMS.iml
@@ -20,7 +20,7 @@
-
+
@@ -29,5 +29,6 @@
+
\ No newline at end of file
diff --git a/deployment/deploy.txt b/deployment/deploy.txt
index d0952bc..4002c30 100644
--- a/deployment/deploy.txt
+++ b/deployment/deploy.txt
@@ -1,5 +1,4 @@
0 windows home 1809
1 java jdk10 默认路径
2 tomcat8.5 默认路径
-3 mariaDB10.3 默认路径
-4
\ No newline at end of file
+3
\ No newline at end of file
diff --git a/src/core/process/Condition.java b/src/core/process/Condition.java
index 9365dbb..4d62665 100644
--- a/src/core/process/Condition.java
+++ b/src/core/process/Condition.java
@@ -4,10 +4,6 @@ import java.util.ArrayList;
import java.util.List;
public class Condition {
- public List getProcesses() {
- return processes;
- }
-
private List processes;
public Process get(int index){
return processes.get(index);
diff --git a/src/core/process/LastProcess.java b/src/core/process/LastProcess.java
index 4c48117..316e405 100644
--- a/src/core/process/LastProcess.java
+++ b/src/core/process/LastProcess.java
@@ -2,7 +2,7 @@ package core.process;
public class LastProcess extends Process{
- public LastProcess(String permission, String operationName, String processOptions, String info) throws Exception {
- super(permission, operationName, processOptions, info);
+ public LastProcess(String info) {
+ super(info);
}
}
diff --git a/src/core/process/ProcessManagement.java b/src/core/process/ProcessManagement.java
index 7223a47..dbffd13 100644
--- a/src/core/process/ProcessManagement.java
+++ b/src/core/process/ProcessManagement.java
@@ -1,23 +1,23 @@
package core.process;
import java.io.File;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class ProcessManagement {
- private List temporaryProcesses;
- private Map> lastProcesses;
- private List auxiliaryProcesses;
+ private List processes;
+ private Map> lastProcesses;
public void setProcessesByJson(File file){
//todo
}
- public Process getTemporaryProcess(int index){
- return temporaryProcesses.get(index);
+ public Process getAtomProcess(int index){
+ return processes.get(index);
}
public Condition getCondition(String userType, List index){
- Condition condition = new Condition(this.lastProcesses.get(userType));
+ Condition condition = new Condition(lastProcesses.get(userType));
for(int i:index){
- condition.add(getTemporaryProcess(i));
+ condition.add(getAtomProcess(i));
}
return condition;
}
diff --git a/src/core/user/User.java b/src/core/user/User.java
index 8048293..0f81d10 100644
--- a/src/core/user/User.java
+++ b/src/core/user/User.java
@@ -11,15 +11,6 @@ public abstract class User implements AccountManageable, ProcessConfigurable{
private String id;
private String password;
private List permissions = null;
-
- public Condition getCondition() {
- return condition;
- }
-
- public void setCondition(Condition condition) {
- this.condition = condition;
- }
-
private Condition condition;
public void addPermission(String permission){
if(!permissions.contains(permission))
diff --git a/src/dao/DBManagement.java b/src/dao/DBManagement.java
index 685c654..e597616 100644
--- a/src/dao/DBManagement.java
+++ b/src/dao/DBManagement.java
@@ -1,8 +1,11 @@
package dao;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
-import error.GExcptSQL;
import org.apache.tomcat.jdbc.pool.DataSource;
import org.apache.tomcat.jdbc.pool.PoolProperties;
@@ -16,24 +19,20 @@ public class DBManagement {
public static DataSource dataSource = new DataSource();
- private static boolean ifInit = false;
-
- public static void init(){
+ public void init(){
PoolProperties poolProperties = new PoolProperties();
poolProperties.setUrl(url);
poolProperties.setDriverClassName(driverClassName);
poolProperties.setUsername(username);
poolProperties.setPassword(password);
dataSource.setPoolProperties(poolProperties);
+ }
+ public static Connection getConnection(){
try {
Class.forName(driverClassName);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
- ifInit = true;
- }
- public static Connection getConnection(){
- if(!ifInit) return null;
try {
return DriverManager.getConnection(url,username,password);
} catch (SQLException e) {
@@ -41,45 +40,4 @@ public class DBManagement {
}
return null;
}
-
- public static ResultSet query(String sql) throws Exception {
- if(!ifInit) return null;
- ResultSet rs = null;
- Connection con = null;
- try{
- con = DBManagement.getConnection();
- Statement stmt = con.createStatement();
- rs = stmt.executeQuery(sql);
- } catch (SQLException e) {
- throw new GExcptSQL("Connect Failure");
- }finally {
- if(con!=null) {
- try {
- con.close();
- } catch (SQLException e) {
- throw new GExcptSQL("Connection Close Failure");
- }
- }
- }
- return rs;
- }
- public static void update(String sql) throws GExcptSQL {
- if(!ifInit) return;
- Connection con = null;
- try{
- con = DBManagement.getConnection();
- Statement stmt = con.createStatement();
- stmt.executeUpdate(sql);
- } catch (SQLException e) {
- throw new GExcptSQL("Connect Failure");
- }finally {
- if(con!=null) {
- try {
- con.close();
- } catch (SQLException e) {
- throw new GExcptSQL("Connection Close Failure");
- }
- }
- }
- }
}
diff --git a/src/init/Init.java b/src/init/Init.java
index 3d42bad..dfc60d4 100644
--- a/src/init/Init.java
+++ b/src/init/Init.java
@@ -13,7 +13,7 @@ import java.io.IOException;
@WebServlet(name = "Init")
public class Init extends HttpServlet {
public void init(){
- DBManagement.init();
+ new DBManagement().init();
new test();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml
index 37a5f89..3d93697 100644
--- a/web/WEB-INF/web.xml
+++ b/web/WEB-INF/web.xml
@@ -12,16 +12,4 @@
Init
/init
-
- default
- *.jpg
-
-
- default
- *.css
-
-
- default
- *.js
-
\ No newline at end of file