public class JNDIConnector extends java.lang.Object implements Connector
Modifier and Type | Field and Description |
---|---|
static int |
COMPOSITE_NAME_LOOKUP |
static int |
COMPOUND_NAME_LOOKUP |
protected javax.naming.Context |
context |
protected javax.sql.DataSource |
dataSource |
protected boolean |
isCallbackRegistered |
protected int |
lookupType
Deprecated.
|
protected java.lang.String |
name |
static int |
STRING_LOOKUP |
static int |
UNDEFINED_LOOKUP |
Constructor and Description |
---|
JNDIConnector()
PUBLIC:
Construct a Connector with no settings.
|
JNDIConnector(javax.naming.Context context,
java.lang.String name)
PUBLIC:
Construct a Connector with the datasource name.
|
JNDIConnector(javax.sql.DataSource dataSource)
PUBLIC:
Construct a Connector with the datasource object.
|
JNDIConnector(java.lang.String name)
PUBLIC:
Construct a Connector with the datasource name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
INTERNAL:
Clone the connector.
|
java.sql.Connection |
connect(java.util.Properties properties,
Session session)
INTERNAL:
Connect with the specified properties and return the Connection.
|
java.lang.String |
getConnectionDetails()
PUBLIC:
Provide the details of my connection information.
|
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.
|
int |
getLookupType()
Deprecated.
As of 2.6.0, replaced by configuration provided by
ServerPlatform.getJNDIConnectorLookupType() |
java.lang.String |
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 |
setLookupType(int lookupType)
Deprecated.
As of 2.6.0, replaced by configuration provided by
ServerPlatform.getJNDIConnectorLookupType() |
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.
|
void |
toString(java.io.PrintWriter writer)
INTERNAL:
Print something useful on the log.
|
protected javax.sql.DataSource dataSource
protected javax.naming.Context context
protected java.lang.String name
protected boolean isCallbackRegistered
public static final int UNDEFINED_LOOKUP
public static final int STRING_LOOKUP
public static final int COMPOSITE_NAME_LOOKUP
public static final int COMPOUND_NAME_LOOKUP
@Deprecated protected int lookupType
public JNDIConnector()
public JNDIConnector(javax.naming.Context context, java.lang.String name) throws ValidationException
ValidationException
public JNDIConnector(java.lang.String name)
public JNDIConnector(javax.sql.DataSource dataSource)
public java.lang.Object clone()
public java.sql.Connection connect(java.util.Properties properties, Session session) throws DatabaseException, ValidationException
connect
in interface Connector
DatabaseException
ValidationException
public javax.naming.Context getContext()
public javax.sql.DataSource getDataSource()
public java.lang.String getName()
public java.lang.String getConnectionDetails()
getConnectionDetails
in interface Connector
public void setContext(javax.naming.Context context)
public void setDataSource(javax.sql.DataSource dataSource)
public void setName(java.lang.String name) throws ValidationException
ValidationException
public void setLookupType(int lookupType)
ServerPlatform.getJNDIConnectorLookupType()
lookupType
- public int getLookupType()
ServerPlatform.getJNDIConnectorLookupType()
public java.lang.String toString()
toString
in class java.lang.Object