|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.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 | |
boolean |
authenticate(java.lang.String userName,
java.lang.String password)
Returns true if the specified user name and password match an employee in the database. |
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.Vector |
getProjects(java.lang.String userName,
java.sql.Connection conn)
Returns a Vector with Row objects describing all projects for the specified employee, or null if not found. |
private Row |
getSingleValueProps(java.lang.String userName,
java.sql.Connection conn)
Returns a Row 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.sql.Date |
toDate(java.lang.String dateString)
Converts a date string in the format "yyyy-MM-dd" to a Date object. |
private java.lang.String[] |
toProjectsArray(java.util.Vector 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 |
|
Field Detail |
private javax.sql.DataSource dataSource
Constructor Detail |
public EmployeeRegistryBean()
Method Detail |
public void setDataSource(javax.sql.DataSource dataSource)
public boolean authenticate(java.lang.String userName, java.lang.String password) throws java.sql.SQLException
public EmployeeBean getEmployee(java.lang.String userName) throws java.sql.SQLException
public void saveEmployee(EmployeeBean empInfo) throws java.sql.SQLException
private Row getSingleValueProps(java.lang.String userName, java.sql.Connection conn) throws java.sql.SQLException
private java.util.Vector getProjects(java.lang.String userName, java.sql.Connection conn) throws java.sql.SQLException
private void saveSingleValueProps(EmployeeBean empInfo, java.sql.Connection conn) throws java.sql.SQLException
private void saveProjects(EmployeeBean empInfo, java.sql.Connection conn) throws java.sql.SQLException
private java.lang.String[] toProjectsArray(java.util.Vector projectRows)
private java.sql.Date toDate(java.lang.String dateString)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |