adminlogin.java

来自「spring+struts+hibernate做的银行系统」· Java 代码 · 共 67 行

JAVA
67
字号
/*
 * Created on 2006-3-25
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package cn.com.tym.admin;

/**
 * @author jack_booth
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */


	import javax.servlet.http.HttpServletRequest;
	/**�û���½�ӿ� 
	 * @author Administrator
	 *
	 * TODO To change the template for this generated type comment go to
	 * Window - Preferences - Java - Code Style - Code Templates
	 */
	public class AdminLogin {
	    /**
	     * �û���½�ж�
	     * @author		wukai			
	     * @param 		employeeID���û���
	     * @param 		password������
	     * @return		0��ʧ�ܣ�1���ɹ�
	     */
/**	    public static int login(HttpServletRequest req,String employeeID,String password) throws SQLException{
			OperateDBBean odbb = new OperateDBBean();
			String sql = "select * from Ssd_HR_FuzzList where employeeid='"+employeeID+"' and pwd='"+password+"'";
			try {
				ResultSet rs = odbb.executeQuery(sql);
				if(rs.next()){
					int EMPLOYEE_SERIALNO = rs.getInt("EMPLOYEE_SERIALNO");
					req.getSession().setAttribute("EmployeeID",employeeID);
					SystemLog.operateLog(req,SystemLog.SQL_LOGIN,"Ssd_HR_FuzzList",String.valueOf(EMPLOYEE_SERIALNO),SystemLog.OPERATE_TYPE_DIRECT);
					return 1;
				}
			} catch (SQLException e) {
				throw e;
			}finally{
				odbb.close();
			}
			
			
			return 0;
	 
	    }
	    
*/
		/**�Ƿ��½
		 * @param req �������session��ȡEmployeeID���ԣ����Ϊ�ձ�ʾ�Ѿ���½
		 * @return 0��δ��½��1���Ѿ���½
		 */
		public static int isLogin(HttpServletRequest request){
	    	Object objAdminId = request.getSession().getAttribute("adminId");
	    	if(objAdminId==null){
	    		return 0;
	    	}
	    	return 1;
	   }
	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?