if (props != null)
{
securityProperties = new Properties();
securityProperties.put(Context.SECURITY_PRINCIPAL, user);
securityProperties.put(Context.SECURITY_CREDENTIALS, password);
securityProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");
}