org.javaWebGen.web
Class LoginDAO
java.lang.Object
org.javaWebGen.data.DAO
org.javaWebGen.web.LoginDAO
public class LoginDAO
- extends DAO
TEST class. Generic basic role based login. Allows Role based security .
Expects the following tables to exist! you can add extra columns but the following
DDL must exist
CREATE TABLE users(
user_name VARCHAR(15),
user_pass VARCHAR(32),
);
CREATE TABLE user_roles(
user_name VARCHAR(15),
role_name VARCHAR(15)
);
- Author:
- kevin scott
Method Summary |
LoginBean |
findLogin(java.lang.String userId,
java.lang.String pass)
find login information about a user if it exist |
java.lang.String[] |
findRoles(java.lang.String userId)
finds all roles used by this user |
Methods inherited from class org.javaWebGen.data.DAO |
close, getColumnClass, getConnection, getDataManager, getNextValue, getNextValue, getResultSet, query, query, query, query, runQuery, runQuery, runQuery, runQuery, setColumn, update, update, update, update, updateDataBean, updateDataBean |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
USER_SQL
public static final java.lang.String USER_SQL
- See Also:
- Constant Field Values
ROLES_SQL
public static final java.lang.String ROLES_SQL
- See Also:
- Constant Field Values
LoginDAO
public LoginDAO()
findLogin
public LoginBean findLogin(java.lang.String userId,
java.lang.String pass)
throws DBException
- find login information about a user if it exist
- Parameters:
userId
- pass
-
- Returns:
- LoginBean
- Throws:
DBException
- could not find user id and password
findRoles
public java.lang.String[] findRoles(java.lang.String userId)
throws DBException
- finds all roles used by this user
- Parameters:
userId
-
- Returns:
- list of roles
- Throws:
DBException
Copyright(C) 2003-2006 Kevin Scott - All Rights Reserved.