DatabaseCommunication
Class UserManager

java.lang.Object
  extended byDatabaseCommunication.UserManager

public class UserManager
extends java.lang.Object

Author:
student This class manages communication of User data with application database.

Constructor Summary
UserManager()
          This is the constructor for UserManager.java
 
Method Summary
static long addDays(java.util.Date startDate, int numberOfDays)
          Method: addDays This method is being used for
 void deleteUserData(UserData data)
          This method is being used to delete user data
 java.lang.String getEmailAddress(java.lang.String fName, java.lang.String lName)
          This method is being used to get the email address of the user
 java.lang.String getName(java.lang.String id)
          This method is being used to get the name of the user using its loginID
 void insertUserData(UserData data)
          This method is being used to insert User data
 UserData[] selectAllUsers()
          This method is being used to select all the registered user
 UserData selectUser(java.lang.String loginId)
          This method is being used to select a user with a particular login Id
 java.lang.String stripTrailing(java.lang.String value)
          This method is being used to strip trailing blanks
 void updateUserData(UserData data)
          This method is being used to update user data
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManager

public UserManager()
This is the constructor for UserManager.java

Method Detail

selectUser

public UserData selectUser(java.lang.String loginId)
                    throws java.lang.Exception
This method is being used to select a user with a particular login Id

Parameters:
loginId - Id of the user you want to select.
Returns:
user data
Throws:
java.lang.Exception - UserData

getEmailAddress

public java.lang.String getEmailAddress(java.lang.String fName,
                                        java.lang.String lName)
                                 throws java.lang.Exception
This method is being used to get the email address of the user

Parameters:
fName - Firstname of the user
lName - Lastname of the user
Returns:
string email address of the user
Throws:
java.lang.Exception - String

getName

public java.lang.String getName(java.lang.String id)
                         throws java.lang.Exception
This method is being used to get the name of the user using its loginID

Parameters:
id - login Id of the user
Returns:
string name of the user
Throws:
java.lang.Exception - String

selectAllUsers

public UserData[] selectAllUsers()
                          throws java.lang.Exception
This method is being used to select all the registered user

Returns:
Throws:
java.lang.Exception - UserData[]

stripTrailing

public java.lang.String stripTrailing(java.lang.String value)
This method is being used to strip trailing blanks


insertUserData

public void insertUserData(UserData data)
                    throws java.lang.Exception
This method is being used to insert User data

Parameters:
data - User data to be inserted.
Throws:
java.lang.Exception - void

updateUserData

public void updateUserData(UserData data)
                    throws java.lang.Exception
This method is being used to update user data

Parameters:
data - User data to be updated
Throws:
java.lang.Exception - void

deleteUserData

public void deleteUserData(UserData data)
                    throws java.lang.Exception
This method is being used to delete user data

Parameters:
data - User data to be deleted
Throws:
java.lang.Exception - void

addDays

public static long addDays(java.util.Date startDate,
                           int numberOfDays)
Method: addDays This method is being used for

Parameters:
startDate -
numberOfDays -
Returns:
long