diff --git a/deployment/deploy.txt b/deployment/deploy.txt index 4002c30..d0952bc 100644 --- a/deployment/deploy.txt +++ b/deployment/deploy.txt @@ -1,4 +1,5 @@ 0 windows home 1809 1 java jdk10 默认路径 2 tomcat8.5 默认路径 -3 \ No newline at end of file +3 mariaDB10.3 默认路径 +4 \ No newline at end of file diff --git a/src/core/operation/Operation.java b/src/core/operation/Operation.java index 195dbfa..74984bc 100644 --- a/src/core/operation/Operation.java +++ b/src/core/operation/Operation.java @@ -2,7 +2,6 @@ package core.operation; import core.user.User; -import error.GExcptSQL; import gdms.Mode; import java.util.Map; @@ -38,6 +37,6 @@ public abstract class Operation { } this.options.put(key,value); } - public abstract void execute(User subject) throws GExcptSQL; + public abstract void execute(User subject); } diff --git a/src/core/operation/Select.java b/src/core/operation/Select.java index 3ea81dd..838308a 100644 --- a/src/core/operation/Select.java +++ b/src/core/operation/Select.java @@ -2,7 +2,6 @@ package core.operation; import core.user.User; import dao.DBManagement; -import error.GExcptSQL; import java.util.Map; @@ -11,7 +10,7 @@ public class Select extends Operation { private Map options; private User subject; @Override - public void execute(User subject) throws GExcptSQL { + public void execute(User subject) { this.setSubject(subject); DBManagement.update("update stu "); } diff --git a/src/core/process/AtomProcess.java b/src/core/process/AtomProcess.java new file mode 100644 index 0000000..777dfe1 --- /dev/null +++ b/src/core/process/AtomProcess.java @@ -0,0 +1,28 @@ +package core.process; + +import core.operation.Operation; +import core.user.User; + + +public class AtomProcess extends Process { + private String permission; + private Operation operation; + private String ButtonName; + private String info; + private String processOptions; + + public AtomProcess(String permission, String operationName, String processOptions, String info) throws Exception { + super(info); + this.permission = permission; + this.operation = (Operation) core.utils.GetObjectByName.getOperationByName(operationName); + this.info = info; + this.processOptions = processOptions; + operation.setProcessOperations(processOptions); + } + public void setUserOperations(String key,Object value){ + this.operation.addUserOperations(key,value); + } + public void execute(User subject){ + this.operation.execute(subject); + } +} diff --git a/src/dao/DBManagement.java b/src/dao/DBManagement.java index d8718a4..685c654 100644 --- a/src/dao/DBManagement.java +++ b/src/dao/DBManagement.java @@ -2,6 +2,7 @@ package dao; import java.sql.*; +import error.GExcptSQL; import org.apache.tomcat.jdbc.pool.DataSource; import org.apache.tomcat.jdbc.pool.PoolProperties; @@ -41,7 +42,7 @@ public class DBManagement { return null; } - public static ResultSet query(String sql) { + public static ResultSet query(String sql) throws Exception { if(!ifInit) return null; ResultSet rs = null; Connection con = null; @@ -50,19 +51,19 @@ public class DBManagement { Statement stmt = con.createStatement(); rs = stmt.executeQuery(sql); } catch (SQLException e) { - e.printStackTrace(); + throw new GExcptSQL("Connect Failure"); }finally { if(con!=null) { try { con.close(); } catch (SQLException e) { - e.printStackTrace(); + throw new GExcptSQL("Connection Close Failure"); } } } return rs; } - public static void update(String sql) { + public static void update(String sql) throws GExcptSQL { if(!ifInit) return; Connection con = null; try{ @@ -70,14 +71,14 @@ public class DBManagement { Statement stmt = con.createStatement(); stmt.executeUpdate(sql); } catch (SQLException e) { - e.printStackTrace(); + throw new GExcptSQL("Connect Failure"); }finally { if(con!=null) { try { con.close(); } catch (SQLException e) { - e.printStackTrace(); - } + throw new GExcptSQL("Connection Close Failure"); + } } } } diff --git a/web/holle.jsp b/web/holle.jsp new file mode 100644 index 0000000..52009c6 --- /dev/null +++ b/web/holle.jsp @@ -0,0 +1,17 @@ +<%-- + Created by IntelliJ IDEA. + User: zhai_ + Date: 2019/1/9 + Time: 10:10 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + + + +