日期:2014-05-19 浏览次数:20642 次
public class LoginAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ActionErrors errors = new ActionErrors(); TlrctlForm tlrctlForm = (TlrctlForm) form; /*String className = "app.poozf.util.PoozfConMete"; this.printFieldsValue(className);*/ try { TlrctlBO tlrctlBo = new TlrctlBO(); //在数据库查找时只用到了Tlrno,没有用到Passwd,所有在下面要比对查询到的密码是否一致 DownAndTlrct downAndTlrct = tlrctlBo.searchDownAndTlrct(tlrctlForm.getTlrno(), tlrctlForm.getPasswd()); Tlrctl tlrctl = downAndTlrct.getTlrctl(); // 操作员
public DownAndTlrct searchDownAndTlrct(String tlrno, String passwd) { Connection con = null; Connection cons = null; DownAndTlrct downAndTlrct = new DownAndTlrct(); try { con = DataSourceUtils.getConnection(pool); // 得到综合业务的连接 //cons = DataSourceUtils.getConnection(pool); TlrctlDAO tlrctlDAO = new TlrctlDAO(con); /** 操作员* */ downAndTlrct.setTlrctl(tlrctlDAO.findByPrimaryKey(tlrno, cons)); /** modify zl 2008-04-08 承德 只有操作员有反洗钱权限的 才查询下拉框* */ // System.out.println(passwd + "-- --"+ downAndTlrct.getTlrctl().getPasswd()); } catch (Exception e) { new ThrowDaoExHandler().handle(con, e); } finally { DataSourceUtils.closeConnection(con); //DataSourceUtils.closeConnection(cons); } return downAndTlrct; }
public static Connection getConnection(ConnectionPool connectionpool)throws SQLException{ Connection connection = null; connection = DriverManager.getConnection("proxool.db_itp_fxq"); if(connection == null) throw new CannotGetJdbcConnectionException("error.getConnection"); else // 不让连接自动提交 connection.setAutoCommit(false); // 解决JDK1.5 连接数据库慢的问题 ProxySelector.setDefault(null); return connection; }