?? role_maintain.java
package imis_manager;
import java.io.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Hashtable;
import database.DBPoolManager;
public class role_maintain {
String roleID;
String roleName;
String purview;
String remark;
String action;
byte temp[];
public void setRoleID(String value){
roleID = ISOtoGB(value);
}
public void setRoleName(String value){
roleName = ISOtoGB(value);
}
public void setPurview(String value){
purview = ISOtoGB(value);
}
public void setRemark(String value){
remark = ISOtoGB(value);
}
public void setAction(String value){
action = ISOtoGB(value);
}
public String ISOtoGB(String in){
String out = "";
if (in == null){
return "";
}
else{
try {
out = new String(in.getBytes("iso-8859-1"),"gb2312");
return out;
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return out;
}
public String GBtoISO(String in){
String out = "";
if (in == null){
return "";
}
else{
try {
out = new String(in.getBytes("gb2312"),"iso-8859-1");
return out;
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return out;
}
public String processthis(){
String result= new String("執(zhí)行成功!");
DBPoolManager dbpool = new DBPoolManager();
dbpool.getConnection();
try {
String sql = null;
Statement stmt = dbpool.conn.createStatement();
if (action.equals("mod")) {
sql="update ManRole set RoleName='"+roleName
+"', ModifyDate=sysdate, Remark='"+remark
+"' where RoleID="+roleID;
stmt.executeUpdate(sql);
}
else if (action.equals("purview")){
sql="update ManRole set Purview='"+purview
+"', ModifyDate=sysdate where RoleID="+roleID;
stmt.executeUpdate(sql);
}
else if (action.equals("add")){
sql="insert into ManRole(RoleName, ModifyDate, Remark)values('"+roleName
+"',sysdate,'"+remark+"')";
stmt.executeUpdate(sql);
}
else if (action.equals("del")){
sql="delete from ManRole where RoleID="+roleID;
stmt.executeUpdate(sql);
}
stmt.close();
} catch (SQLException ex) {
result = "執(zhí)行出錯(cuò)!";
System.err.println("Get role_maintain SQLException: " + ex.toString());
} finally {
dbpool.freeConnection();
}
return result;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -