com.pchauvet.struttlogin
Class UserProfileEJBConnectionBean

java.lang.Object
  |
  +--com.pchauvet.struttlogin.UserProfileEJBConnectionBean

public class UserProfileEJBConnectionBean
extends java.lang.Object

Access the UserProfile table using an EJB connection.

Version:
1.0
Author:
Philip Jahmani Chauvet. abc1260@aol.com

Constructor Summary
UserProfileEJBConnectionBean()
          The constructor.
 
Method Summary
 void closeJNDIConnection()
          Close the JNDI connection.
 boolean getJNDIConnection()
          Test if the JNDI connection exist for the home interface
 com.pchauvet.struttlogin.UserProfileBean getUser()
          Set the UserProfileBean
 com.pchauvet.struttlogin.UserProfileBean getUser(java.lang.String m_userid)
          Get a user record using the EJB.
 void setJNDIConnection()
          Set the JNDI connection for the UserProfile table.
 com.pchauvet.struttlogin.UserProfileBean setUser(java.lang.String m_userid, java.lang.String m_password, java.lang.String m_firstname, java.lang.String m_lastname, java.lang.String m_email, java.lang.String m_address, java.lang.String m_city, java.lang.String m_state, java.lang.String m_postalcode, java.lang.String m_country, java.lang.String m_sex, java.lang.String m_status)
          Create a new user profile in the UserProfile table.
 void setUser(com.pchauvet.struttlogin.UserProfileBean m_userprofilebean)
          Set the UserProfileBean
 com.pchauvet.struttlogin.UserProfileBean updUser(java.lang.String m_userid, java.lang.String m_password, java.lang.String m_firstname, java.lang.String m_lastname, java.lang.String m_email, java.lang.String m_address, java.lang.String m_city, java.lang.String m_state, java.lang.String m_postalcode, java.lang.String m_country, java.lang.String m_sex, java.lang.String m_status)
          Update a user profile in the UserProfile table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserProfileEJBConnectionBean

public UserProfileEJBConnectionBean()
The constructor. It establishes the JNDI connection by calling the setJNDIConnection().

Method Detail

setJNDIConnection

public void setJNDIConnection()
Set the JNDI connection for the UserProfile table.
1. Set the EJB Server Factory and URI information as a system property entry. TODO: Read this information as a Datasource or from and XML file.
2. Get the home interface for the EJB


getJNDIConnection

public boolean getJNDIConnection()
Test if the JNDI connection exist for the home interface

Returns:
true if a home interface exist (UserProfileHome), else false.

getUser

public com.pchauvet.struttlogin.UserProfileBean getUser(java.lang.String m_userid)
Get a user record using the EJB.
1. find a profile record using EJBs (UserProfile) Remote Interface from the Home Interfaces (UserProfileHome) findByPrimaryKey( m_m_userid ).
2. Create a UserProfileBean. from the (UserProfile) EJB Remote Interface information.
3. Set the user UserProfileBean's information

Returns:
UserProfileBean - A user profile entry from the UserProfile table.

setUser

public com.pchauvet.struttlogin.UserProfileBean setUser(java.lang.String m_userid,
                                                        java.lang.String m_password,
                                                        java.lang.String m_firstname,
                                                        java.lang.String m_lastname,
                                                        java.lang.String m_email,
                                                        java.lang.String m_address,
                                                        java.lang.String m_city,
                                                        java.lang.String m_state,
                                                        java.lang.String m_postalcode,
                                                        java.lang.String m_country,
                                                        java.lang.String m_sex,
                                                        java.lang.String m_status)
Create a new user profile in the UserProfile table.
1. Create a profile using EJBs (UserProfile) create() method of the
Home Interfaces (UserProfileHome).
2. Create a UserProfileBean from the (UserProfile) EJB Remote Interface information.
3. Set the user UserProfileBean's information.
4. If an entry is found for the "userid", the user profile information is updated.

Parameters:
m_userid - The user's Login ID.
m_password - The user Password
m_firstname - The first name
m_lastname - The last name
m_email - The email
m_address - The address
m_city - The city
m_state - The state
m_postalcode - The zip code or postal code
m_country - The country
m_sex - The users sex
m_status - The record status used to flag the user entry as 'A'ctive, 'H'eld, 'D'ead processing status
Returns:
UserProfileBean - A user profile record

updUser

public com.pchauvet.struttlogin.UserProfileBean updUser(java.lang.String m_userid,
                                                        java.lang.String m_password,
                                                        java.lang.String m_firstname,
                                                        java.lang.String m_lastname,
                                                        java.lang.String m_email,
                                                        java.lang.String m_address,
                                                        java.lang.String m_city,
                                                        java.lang.String m_state,
                                                        java.lang.String m_postalcode,
                                                        java.lang.String m_country,
                                                        java.lang.String m_sex,
                                                        java.lang.String m_status)
Update a user profile in the UserProfile table.
1. Update a profile using EJBs (UserProfile) create() method of the Home Interfaces (UserProfileHome).
2. Update a UserProfileBean from the (UserProfile) EJB Remote Interface information.
3. Set the user UserProfileBean's information.
4. If an entry is found for the "userid" the user profile information is updated.

Parameters:
m_userid - The user's Login ID.
m_password - The user Password
m_firstname - The first name
m_lastname - The last name
m_email - The email
m_address - The address
m_city - The city
m_state - The state
m_postalcode - The zip code or postal code
m_country - The country
m_sex - The users sex
m_status - The record status used to flag the user entry as 'A'ctive, 'H'eld, 'D'ead processing status
Returns:
UserProfileBean - A user profile record

closeJNDIConnection

public void closeJNDIConnection()
Close the JNDI connection. Set the home interface (UserProfileHome) to null


setUser

public void setUser(com.pchauvet.struttlogin.UserProfileBean m_userprofilebean)
Set the UserProfileBean


getUser

public com.pchauvet.struttlogin.UserProfileBean getUser()
Set the UserProfileBean

Returns:
UserProfileBean - Get the user Login information


Back to the Web Application
Copyright © 2003 Philip Chauvet: (718) 241.3602 or abc1260@aol.com.
Permission is granted to reuse and distribute for commercial or personal use.
I am looking for work and would appreciate doing business with you and developing J2EE applications for you.