org.javaWebGen.web
Class LoginDAO

java.lang.Object
  extended by org.javaWebGen.data.DAO
      extended by 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

Field Summary
static java.lang.String ROLES_SQL
           
static java.lang.String USER_SQL
           
 
Fields inherited from class org.javaWebGen.data.DAO
TOO_MANY_ROWS, TOO_MANY_ROWS_WARNING
 
Constructor Summary
LoginDAO()
           
 
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
 

Field Detail

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
Constructor Detail

LoginDAO

public LoginDAO()
Method Detail

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.