Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| WebLogic Integration
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.wlpi.server.common
Class JNDIHelper

    java.lang.Object
      |
      +--com.bea.wlpi.server.common.JNDIHelper

public final class JNDIHelper
extends java.lang.Object

This class defines static methods that can be used to get a Context object to the WLS JNDI tree.

Author:
  Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.

Method Summary
`static javax.sql.DataSource` | `getDataSource(java.lang.String name)` This method returns a DataSource object from JNDI.
`static javax.sql.DataSource` | `getDataSource(java.lang.String name, javax.naming.Context ctx)` This method returns a DataSource object from JNDI.
`static javax.naming.InitialContext` | `getInitialContext()` This method can be used if the object is in WLS and does not need to specify a username
`static javax.naming.InitialContext` | `getInitialContext(java.lang.String url)` This method allows access to different URLs, but with the default username.
`static javax.naming.InitialContext` | `getInitialContext(java.lang.String username, java.lang.Object credentials)` This method is used on the server when a new username is needed for the JNDI context.
`static javax.naming.InitialContext` | `getInitialContext(java.lang.String url, java.lang.String username, java.lang.Object credentials)` This method allows code to specify the username and URL to connect with.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInitialContext

    public static javax.naming.InitialContext getInitialContext()
                                                         throws javax.naming.NamingException

  This method can be used if the object is in WLS and does not need to specify a username

  Returns:
    javax.naming.Context
  Throws:
    javax.naming.NamingException -

### getInitialContext

    public static javax.naming.InitialContext getInitialContext(java.lang.String url)
                                                         throws javax.naming.NamingException

  This method allows access to different URLs, but with the default username.

  Parameters:
    `url` -
  Returns:
    javax.naming.Context
  Throws:
    javax.naming.NamingException -

### getInitialContext

    public static javax.naming.InitialContext getInitialContext(java.lang.String username,
                                                                java.lang.Object credentials)
                                                         throws javax.naming.NamingException

  This method is used on the server when a new username is needed for the JNDI context.

  Parameters:
    `username` -
    `credentials` -
  Returns:
    javax.naming.Context
  Throws:
    javax.naming.NamingException -

### getInitialContext

    public static javax.naming.InitialContext getInitialContext(java.lang.String url,
                                                                java.lang.String username,
                                                                java.lang.Object credentials)
                                                         throws javax.naming.NamingException

  This method allows code to specify the username and URL to connect with. In WLS, the username will be propagated to the work thread the JNDI Context object is associated with.

  Parameters:
    `url` -
    `username` -
    `credentials` -
  Returns:
    javax.naming.Context
  Throws:
    javax.naming.NamingException -

### getDataSource

    public static javax.sql.DataSource getDataSource(java.lang.String name,
                                                     javax.naming.Context ctx)
                                              throws javax.naming.NamingException

  This method returns a DataSource object from JNDI.

  Parameters:
    `String` - Name of the DataSource object
    `Context` - Context to JNDI. If null, this will attempt to grab a default Context
  Returns:
    DataSource object from JNDI
  Throws:
    javax.naming.NamingException -

### getDataSource

    public static javax.sql.DataSource getDataSource(java.lang.String name)
                                              throws javax.naming.NamingException

  This method returns a DataSource object from JNDI.

  Parameters:
    `String` - Name of the DataSource object
  Returns:
    DataSource object from JNDI
  Throws:
    javax.naming.NamingException -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| WebLogic Integration
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

WebLogic Integration (WLI)