Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.jndi
Class JNDIConnector

java.lang.Object
  extended byoracle.toplink.jndi.JNDIConnector

All Implemented Interfaces:
java.lang.Cloneable, Connector, java.io.Serializable

public class JNDIConnector
extends java.lang.Object
implements Connector

Use this Connector to build a java.sql.Connection in the "recommended" JDBC 2.0 fashion, via a JNDI Context-supplied DataSource. Construct the Connector with a Context and a name that can be used by TopLink to look up a JDBC DataSource within that Context.

Since:
TOPLink/Java 2.1
See Also:
Serialized Form

Constructor Summary
JNDIConnector()
PUBLIC: Construct a Connector with no settings.
JNDIConnector(javax.naming.Context context, javax.naming.Name name)
PUBLIC: Construct a Connector with the specified settings.
JNDIConnector(javax.naming.Context context, java.lang.String name)
PUBLIC: Construct a Connector with the specified settings.
JNDIConnector(javax.sql.DataSource dataSource)
PUBLIC: Construct a Connector with the specified settings.

Method Summary
javax.naming.Context getContext()
PUBLIC: Return the JNDI Context that can supplied the named DataSource.
javax.sql.DataSource getDataSource()
PUBLIC: Return the javax.sql.DataSource.
javax.naming.Name getName()
PUBLIC: Return the name of the DataSource within the JNDI Context.
void setContext(javax.naming.Context context)
PUBLIC: Set the JNDI Context that can supply the named DataSource.
void setDataSource(javax.sql.DataSource dataSource)
PUBLIC: Set the javax.sql.DataSource.
void setName(javax.naming.Name name)
PUBLIC: Set the name of the DataSource within the JNDI Context.
void setName(java.lang.String name)
PUBLIC: Set the name of the DataSource within the JNDI Context.
java.lang.String toString()
PUBLIC: Print data source info.

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

JNDIConnector

public JNDIConnector()
PUBLIC: Construct a Connector with no settings. The context and datasource name will still need to be set.

JNDIConnector

public JNDIConnector(javax.naming.Context context,
                     java.lang.String name)
              throws ValidationException
PUBLIC: Construct a Connector with the specified settings.

JNDIConnector

public JNDIConnector(javax.naming.Context context,
                     javax.naming.Name name)
PUBLIC: Construct a Connector with the specified settings.

JNDIConnector

public JNDIConnector(javax.sql.DataSource dataSource)
PUBLIC: Construct a Connector with the specified settings.

Method Detail

getContext

public javax.naming.Context getContext()
PUBLIC: Return the JNDI Context that can supplied the named DataSource.

getDataSource

public javax.sql.DataSource getDataSource()
PUBLIC: Return the javax.sql.DataSource.

getName

public javax.naming.Name getName()
PUBLIC: Return the name of the DataSource within the JNDI Context.

setContext

public void setContext(javax.naming.Context context)
PUBLIC: Set the JNDI Context that can supply the named DataSource.

setDataSource

public void setDataSource(javax.sql.DataSource dataSource)
PUBLIC: Set the javax.sql.DataSource.

setName

public void setName(java.lang.String name)
             throws ValidationException
PUBLIC: Set the name of the DataSource within the JNDI Context.
Throws:
ValidationException

setName

public void setName(javax.naming.Name name)
PUBLIC: Set the name of the DataSource within the JNDI Context.

toString

public java.lang.String toString()
PUBLIC: Print data source info.

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.