Class JNDIUtil

    • Method Detail

      • getNamingContext

        public static Context getNamingContext​(Properties jndiProperties)
                                        throws NamingException
        Get the JNDI Context.

        Don't forget to close it when done!

        Parameters:
        jndiProperties - JNDI properties.
        Returns:
        The context.
        Throws:
        NamingException - Error getting context.
      • lookup

        public static Object lookup​(String objectName,
                                    Properties jndiProperties)
                             throws NamingException
        Lookup an object through the JNDI context.
        Parameters:
        objectName - The name of the object to be looked up.
        jndiProperties - JNDI properties.
        Returns:
        The object.
        Throws:
        NamingException - Error getting object.
      • getDefaultProperties

        public static Properties getDefaultProperties()