📄 findpswdbean.java
字号:
package psdi.webclient.beans.signature;
import java.io.UnsupportedEncodingException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import psdi.mbo.MboRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
import psdi.webclient.system.beans.AppBean;
import psdi.webclient.system.controller.Utility;
public class FindPswdBean extends AppBean {
public int submit() throws MXException, RemoteException {
String password = "";
MboRemote mboremote = getMbo();
password = getPassword(mboremote.getString("loginid"));
if (!"".equals(password))
Utility.showMessageBox(sessionContext.getCurrentEvent(), "signature", "passwordIs", new String[]{password});
return 1;
}
public String getPassword(String loginid) throws RemoteException,
MXException {
Connection conn = null;
PreparedStatement pst = null;
String password = "";
try {
conn = MXServer.getMXServer().getDBManager().getSystemConnection();
String sql = "select password from maxuser where loginid='" + loginid
+ "'";
pst = conn.prepareStatement(sql);
ResultSet rs = pst.executeQuery();
while (rs.next()) {
byte pwd[] = rs.getBytes("password");
CustMXCipherX cipher = new CustMXCipherX(getMXSession()
.getMXServerRemote());
byte[] realPwd = cipher.decData(pwd);
password = new String(realPwd, "ISO-8859-1");
}
} catch (SQLException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} finally {
if (pst != null)
try {
pst.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return password.trim();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -