|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ora.jsp.beans.emp.EmployeeRegistryBean
This class is an example of an application specific interface to a database. It contains methods for authenticating a user, and retrieving and updating user information.
Field Summary | |
private javax.sql.DataSource |
dataSource
|
Constructor Summary | |
EmployeeRegistryBean()
|
Method Summary | |
EmployeeBean |
authenticate(java.lang.String userName,
java.lang.String password)
Returns an EmployeeBean if the specified user name and password match an employee in the database, otherwise null. |
EmployeeBean |
getEmployee(java.lang.String userName)
Returns an EmployeeBean initialized with the information found in the database for the specified employee, or null if not found. |
private java.util.Map[] |
getProjects(java.lang.String userName,
java.sql.Connection conn)
Returns a Map[] with a Map per project for the specified employee, or null if not found. |
private java.util.Map |
getSingleValueProps(java.lang.String userName,
java.sql.Connection conn)
Returns a Map with all information about the specified employee except the project list, or null if not found. |
void |
saveEmployee(EmployeeBean empInfo)
Inserts the information about the specified employee, or updates the information if it's already defined. |
private void |
saveProjects(EmployeeBean empInfo,
java.sql.Connection conn)
Updates or inserts project information for the specified employee. |
private void |
saveSingleValueProps(EmployeeBean empInfo,
java.sql.Connection conn)
Inserts the information about the specified employee (except projects), or updates the information if it's already defined. |
void |
setDataSource(javax.sql.DataSource dataSource)
Sets the dataSource property value. |
private java.lang.String[] |
toProjectsArray(java.util.Map[] projectRows)
Converts a Vector with Row elements containing a ProjectName column to a String[] with the project names. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private javax.sql.DataSource dataSource
Constructor Detail |
public EmployeeRegistryBean()
Method Detail |
public void setDataSource(javax.sql.DataSource dataSource)
public EmployeeBean authenticate(java.lang.String userName, java.lang.String password) throws java.sql.SQLException
java.sql.SQLException
public EmployeeBean getEmployee(java.lang.String userName) throws java.sql.SQLException
java.sql.SQLException
public void saveEmployee(EmployeeBean empInfo) throws java.sql.SQLException
java.sql.SQLException
private java.util.Map getSingleValueProps(java.lang.String userName, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
private java.util.Map[] getProjects(java.lang.String userName, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
private void saveSingleValueProps(EmployeeBean empInfo, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
private void saveProjects(EmployeeBean empInfo, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
private java.lang.String[] toProjectsArray(java.util.Map[] projectRows)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |