wlf
zhai_lw 6 years ago
parent fd6c9b7c93
commit 3ca251506a

@ -1,4 +1,5 @@
0 windows home 1809
1 java jdk10 默认路径
2 tomcat8.5 默认路径
3
3 mariaDB10.3 默认路径
4

@ -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);
}

@ -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<String, Object> options;
private User subject;
@Override
public void execute(User subject) throws GExcptSQL {
public void execute(User subject) {
this.setSubject(subject);
DBManagement.update("update stu ");
}

@ -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);
}
}

@ -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");
}
}
}
}

@ -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" %>
<html>
<head>
<title>Title</title>
<script type="text/javascript" src="test2.js"></script>
</head>
<body>
</body>
</html>
Loading…
Cancel
Save