📄 dbsoft.java
字号:
}
} catch (SQLException e) {
ps = null;
}
try {
if (con != null) {
con.close();
con = null;
}
} catch (SQLException e) {
con = null;
}
}
return coll;
}
private boolean Update() {
boolean b = false;
Connection con = null;
PreparedStatement ps = null;
try {
con = Database.getConnection();
ps = con.prepareStatement(FinalConstants.UPDATE_SOFT);
ps.setString(1, s.getName());
ps.setString(2, s.getEdition());
ps.setFloat(3, s.getPrice());
ps.setString(4, s.getIid());
ps.setInt(5, s.getSid());
ps.setString(6, s.getEnvironment());
ps.setInt(7, s.getFilesize());
ps.setInt(8, s.getCommend());
ps.setInt(9, s.getLoadnum());
ps.setInt(10, s.getRegular());
ps.setString(11, s.getIntroduce());
ps.setString(12, StringUtils.toUnicode(s.getPath()));
ps.setString(13, s.getResume());
ps.setInt(14, s.getSfid());
if (ps.executeUpdate() > 0) {
b = true;
} else {
b = false;
}
} catch (SQLException e) {
b = false;
e.printStackTrace();
} finally {
System.out.println(ps + " Dbsoft.Update() ");
try {
if (ps != null) {
ps.close();
}
} catch (SQLException e) {
ps = null;
}
try {
if (con != null) {
con.close();
}
} catch (SQLException e) {
con = null;
}
}
return b;
}
private boolean Update_load() {
boolean b = false;
Connection con = null;
PreparedStatement ps = null;
try {
con = Database.getConnection();
ps = con.prepareStatement(FinalConstants.UPDATE_SOFT_LOAD);
ps.setInt(1, s.getLoadnum());
ps.setInt(2, s.getSfid());
if (ps.executeUpdate() > 0) {
b = true;
} else {
b = false;
}
} catch (SQLException e) {
b = false;
e.printStackTrace();
} finally {
System.out.println(ps + " Dbsoft.Update() ");
try {
if (ps != null) {
ps.close();
}
} catch (SQLException e) {
ps = null;
}
try {
if (con != null) {
con.close();
}
} catch (SQLException e) {
con = null;
}
}
return b;
}
public int getSfid() {
return s.getSfid();
}
public void setSfid(int sfid) {
s.setSfid(sfid);
}
public String getName() {
return s.getName();
}
public void setName(String name) {
s.setName(name);
Update();
}
public String getEdition() {
return s.getEdition();
}
public void setEdition(String edition) {
s.setEdition(edition);
Update();
}
public float getPrice() {
return s.getPrice();
}
public void setPrice(float price) {
s.setPrice(price);
Update();
}
public String getUptime() {
return s.getUptime();
}
public void setUptime(String uptime) {
s.setUptime(uptime);
}
public String getUid() {
return s.getUid();
}
public void setUid(String uid) {
s.setUid(uid);
Update();
}
public String getIid() {
return s.getIid();
}
public void setIid(String iid) {
s.setIid(iid);
Update();
}
public int getSid() {
return s.getSid();
}
public void setSid(int sid) {
s.setSid(sid);
Update();
}
public String getEnvironment() {
return s.getEnvironment();
}
public void setEnvironment(String environment) {
s.setEnvironment(environment);
Update();
}
public int getFilesize() {
return s.getFilesize();
}
public void setFilesize(int filesize) {
s.setFilesize(filesize);
Update();
}
public int getCommend() {
return s.getCommend();
}
public void setCommend(int commend) {
s.setCommend(commend);
Update();
}
public int getLoadnum() {
return s.getLoadnum();
}
public void setLoadnum(int loadnum) {
s.setLoadnum(loadnum);
Update_load();
}
public int getRegular() {
return s.getRegular();
}
public void setRegular(int regular) {
s.setRegular(regular);
Update();
}
public String getIntroduce() {
return s.getIntroduce();
}
public void setIntroduce(String introduce) {
s.setIntroduce(introduce);
Update();
}
public String getPath() {
return s.getPath();
}
public void setPath(String path) {
s.setPath(path);
Update();
}
public String getResume() {
return s.getResume();
}
public void setResume(String resume) {
s.setResume(resume);
Update();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -