Purpose: Hold the configuration information necessary to connect to a datasource.
Description: This is an abstract class that defines the common datasource independent connection configuration. It is extended to support specific datasources such as JDBC, JCA, XML, etc.
| Modifier and Type | Field and Description |
|---|---|
| protected int | cacheTransactionIsolation
By default concurrency is optimized and the cache is not locked during reads or writes, This allows for concurrent reading and writing and should never cause any problems. |
| public static final int | CONCURRENT_READ_WRITE
Reads and unit of work merges can occur concurrently. |
| protected Connector | connector
Provide a little flexibility for connecting to a database |
| private boolean | isEncryptedPasswordSet
The securable object holder and flag |
| protected Platform | platform
Implementation of platform-specific behaviors. |
| protected Properties | properties
Connection properties (e.g. user, password, and driver-specific settings) |
| private transient SecurableObjectHolder | |
| public static final int | SYNCHRONIZED_READ_ON_WRITE
Reads and unit of work merges will be serialized. |
| public static final int | SYNCHRONIZED_WRITE
Reads can occur concurrently but unit of work merges will be serialized. |
| public static final int | SYNCRONIZED_OBJECT_LEVEL_READ_WRITE
Writes to the cache (merge, object build/refresh will be synchronized as will cache access (cloning) based on when access is required. |
| public static final int | SYNCRONIZED_OBJECT_LEVEL_READ_WRITE_DATABASE
Writes to the cache (merge, object build/refresh will be synchronized as will cache access (cloning) based on database transaction. |
| protected boolean | usesExternalConnectionPooling
True if we use an external connection pool such as WebLogic's JTS driver |
| protected boolean | usesExternalTransactionController
True if we should use some external transaction service such as JTS. |
| public static String | |
| private static final String | versionStringTemplate
Version info |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addSequence(Sequence sequence)
Add sequence corresponding to the name Don't use if the session is connected. |
| public DatasourceLogin | clone()
Overrides java. Implements org. |
| public Object | connectToDatasource(Accessor accessor, Session session)
Implements org. |
| public void | |
| public void | dontUseExternalTransactionController()
PUBLIC: Let EclipseLink control transactions instead of some external transaction service such as JTS. |
| public int | getCacheTransactionIsolation()
ADVANCED: By default concurrency is optimized and the cache is not locked more than required during reads or writes, This allows for virtual concurrent reading and writing and should never cause any problems. |
| public Connector | |
| public Platform | getDatasourcePlatform()
Implements org. |
| public Sequence | |
| public Sequence | |
| public String | |
| public DatabasePlatform | getPlatform()
Implements org. |
| public String | |
| public Properties | getProperties()
INTERNAL: The properties are additional, driver-specific, connection information to be passed to the driver. |
| public Object | getProperty(String name)
Implements org. |
| protected SecurableObjectHolder | |
| public Sequence | |
| public Map | |
| public Map | |
| public String | getTableQualifier()
Implements org. |
| public String | getUserName()
Implements org. |
| public static String | |
| public boolean | isConnectionHealthValidatedOnError()
Implements org. |
| private Properties | prepareProperties(Session
current session used for logging session)SECURE: The password in the login properties is encrypted. |
| public void | |
| public void | removeProperty(String propertyName)
PUBLIC: Some drivers don't like the "user" and "password" properties. |
| public Sequence | |
| public void | setCacheTransactionIsolation(int cacheTransactionIsolation)
ADVANCED: By default concurrency is optimized and the cache is not locked more than required during reads or writes, This allows for virtual concurrent reading and writing and should never cause any problems. |
| public void | |
| public void | setDatasourcePlatform(Platform platform)
Implements org. |
| public void | setDefaultNullValue(Class<?> type, Object value)
PUBLIC: The default value to substitute for database NULLs can be configured on a per-class basis. |
| public void | |
| public void | |
| public void | |
| public void | setPassword(String password)
Implements org. |
| public void | setPlatform(Platform platform)
Implements org. |
| public void | |
| public void | setPlatformClassName(String platformClassName, ClassLoader loader)
INTERNAL: Set the name of the Platform to be created using the passed in class loader. |
| public void | setProperties(Properties properties)
Implements org. |
| public void | setProperty(String propertyName, Object propertyValue)
Implements org. |
| public void | |
| public void | |
| public void | setTimestampQuery(ValueReadQuery timestampQuery)
PUBLIC: Override the default query for returning a timestamp from the server. |
| public void | setUserName(String name)
Implements org. |
| public void | setUsesExternalConnectionPooling(boolean usesExternalConnectionPooling)
PUBLIC: Return whether EclipseLink uses some external connection pooling service such as a JDBC 2.0 driver. |
| public void | setUsesExternalTransactionController(boolean usesExternalTransactionController)
PUBLIC: Return whether EclipseLink uses some external transaction service such as JTS. |
| public boolean | shouldAllowConcurrentReadWrite()
Implements org. |
| public boolean | shouldSynchronizedReadOnWrite()
Implements org. |
| public boolean | shouldSynchronizeObjectLevelReadWrite()
Implements org. |
| public boolean | shouldSynchronizeObjectLevelReadWriteDatabase()
Implements org. |
| public boolean | shouldSynchronizeWrites()
Implements org. |
| public boolean | shouldUseExternalConnectionPooling()
Implements org. |
| public boolean | shouldUseExternalTransactionController()
Implements org. |
| public String | |
| public void | |
| public void | useExternalTransactionController()
PUBLIC: Use an external transaction controller such as a JTS service |
| public void |
| cacheTransactionIsolation | back to summary |
|---|---|
| protected int cacheTransactionIsolation By default concurrency is optimized and the cache is not locked during reads or writes, This allows for concurrent reading and writing and should never cause any problems. If the application uses no form of locking the last unit of work to merge changes will win, with no locking it is possible only under this scenario for two unit of works to merge changes different than the database although highly unlikely and if occurred is the entire purpose of locking. This property allows for the isolation level of changes to the cache to be configured for sever situation and it is not suggest that this be changed. | |
| CONCURRENT_READ_WRITE | back to summary |
|---|---|
| public static final int CONCURRENT_READ_WRITE Reads and unit of work merges can occur concurrently. | |
| connector | back to summary |
|---|---|
| protected Connector connector Provide a little flexibility for connecting to a database | |
| isEncryptedPasswordSet | back to summary |
|---|---|
| private boolean isEncryptedPasswordSet The securable object holder and flag | |
| platform | back to summary |
|---|---|
| protected Platform platform Implementation of platform-specific behaviors. | |
| properties | back to summary |
|---|---|
| protected Properties properties Connection properties (e.g. user, password, and driver-specific settings) | |
| securableObjectHolder | back to summary |
|---|---|
| private transient SecurableObjectHolder securableObjectHolder | |
| SYNCHRONIZED_READ_ON_WRITE | back to summary |
|---|---|
| public static final int SYNCHRONIZED_READ_ON_WRITE Reads and unit of work merges will be serialized. | |
| SYNCHRONIZED_WRITE | back to summary |
|---|---|
| public static final int SYNCHRONIZED_WRITE Reads can occur concurrently but unit of work merges will be serialized. | |
| SYNCRONIZED_OBJECT_LEVEL_READ_WRITE | back to summary |
|---|---|
| public static final int SYNCRONIZED_OBJECT_LEVEL_READ_WRITE Writes to the cache (merge, object build/refresh will be synchronized as will cache access (cloning) based on when access is required. | |
| SYNCRONIZED_OBJECT_LEVEL_READ_WRITE_DATABASE | back to summary |
|---|---|
| public static final int SYNCRONIZED_OBJECT_LEVEL_READ_WRITE_DATABASE Writes to the cache (merge, object build/refresh will be synchronized as will cache access (cloning) based on database transaction. | |
| usesExternalConnectionPooling | back to summary |
|---|---|
| protected boolean usesExternalConnectionPooling True if we use an external connection pool such as WebLogic's JTS driver | |
| usesExternalTransactionController | back to summary |
|---|---|
| protected boolean usesExternalTransactionController True if we should use some external transaction service such as JTS. | |
| versionString | back to summary |
|---|---|
| public static String versionString | |
| versionStringTemplate | back to summary |
|---|---|
| private static final String versionStringTemplate Version info | |
| DatasourceLogin | back to summary |
|---|---|
| protected DatasourceLogin() PUBLIC: Create a new login. | |
| DatasourceLogin | back to summary |
|---|---|
| protected DatasourceLogin(Platform databasePlatform) ADVANCED: Create a new login for the given platform. | |
| addSequence | back to summary |
|---|---|
| public void addSequence(Sequence sequence) Add sequence corresponding to the name Don't use if the session is connected. | |
| clone | back to summary |
|---|---|
| public DatasourceLogin clone() Overrides java. Implements org. INTERNAL: Clone the login. This also clones the platform as it is internal to the login.
| |
| connectToDatasource | back to summary |
|---|---|
| public Object connectToDatasource(Accessor accessor, Session session) throws DatabaseException Implements org. INTERNAL: Connect to the datasource, and return the driver level connection object.
| |
| dontUseExternalConnectionPooling | back to summary |
|---|---|
| public void dontUseExternalConnectionPooling() PUBLIC: Do not use external connection pooling. This is appropriate if using regular EclipseLink connection pooling and regular JDBC drivers.
| |
| dontUseExternalTransactionController | back to summary |
|---|---|
| public void dontUseExternalTransactionController() PUBLIC: Let EclipseLink control transactions instead of some external transaction service such as JTS.
| |
| getCacheTransactionIsolation | back to summary |
|---|---|
| public int getCacheTransactionIsolation() ADVANCED: By default concurrency is optimized and the cache is not locked more than required during reads or writes, This allows for virtual concurrent reading and writing and should never cause any problems. If the application uses no form of locking the last unit of work to merge changes will win, with no locking it is possible only under this scenario for two unit of works to merge changes different than the database although highly unlikely and if occurred is the entire purpose of locking and locking is the suggested solution if this is a problem. This property allows for the isolation level of changes to the cache to be configured for sever situations and it is not suggest that this be changed. Setting are:
| |
| getConnector | back to summary |
|---|---|
| public Connector getConnector() ADVANCED: Return the connector that will instantiate the connection. | |
| getDatasourcePlatform | back to summary |
|---|---|
| public Platform getDatasourcePlatform() Implements org. PUBLIC: Return the datasource platform specific information. This allows EclipseLink to configure certain advanced features for the datasource desired.
| |
| getDefaultSequence | back to summary |
|---|---|
| public Sequence getDefaultSequence() Get default sequence | |
| getDefaultSequenceToWrite | back to summary |
|---|---|
| public Sequence getDefaultSequenceToWrite() INTERNAL: Used only for writing the login into XML or Java. | |
| getPassword | back to summary |
|---|---|
| public String getPassword() Implements org. Return the password. It will be encrypted.
| |
| getPlatform | back to summary |
|---|---|
| public DatabasePlatform getPlatform() Implements org. INTERNAL: Return the database platform specific information. This allows EclipseLink to configure certain advanced features for the database desired. Note this must only be used for relational specific usage and will not work for non-relational datasources.
| |
| getPlatformClassName | back to summary |
|---|---|
| public String getPlatformClassName() INTERNAL: Return the name of the database platform class. | |
| getProperties | back to summary |
|---|---|
| public Properties getProperties() INTERNAL: The properties are additional, driver-specific, connection information to be passed to the driver. Note Do not set the password directly by getting the properties and setting the "password" property directly. Use the method DatabaseLogin.setPassword(String). | |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name) Implements org. PUBLIC: The properties are additional, driver-specific, connection information to be passed to the driver. Note Do not set the password directly by getting the properties and setting the "password" property directly. Use the method DatabaseLogin.setPassword(String).
| |
| getSecurableObjectHolder | back to summary |
|---|---|
| protected SecurableObjectHolder getSecurableObjectHolder() INTERNAL: Return the encryption securable holder. Lazy initialize to handle serialization. | |
| getSequence | back to summary |
|---|---|
| public Sequence getSequence(String seqName) Get sequence corresponding to the name | |
| getSequences | back to summary |
|---|---|
| public Map Returns a map of sequence names to Sequences (may be null). | |
| getSequencesToWrite | back to summary |
|---|---|
| public Map INTERNAL: Used only for writing the login into XML or Java. | |
| getTableQualifier | back to summary |
|---|---|
| public String getTableQualifier() Implements org. PUBLIC: Return the qualifier for the all of the tables referenced by EclipseLink. This can be the creator of the table or database name the table exists on. This is required by some databases such as Oracle and DB2. This should only be used if all of the tables have the same qualifier. It can also be set on each descriptor when the table name is specified.
| |
| getUserName | back to summary |
|---|---|
| public String getUserName() Implements org. PUBLIC: The user name is the database login name. Some databases do not require a user name or the user is obtained from the OS, in this case the user name not be specified.
| |
| getVersion | back to summary |
|---|---|
| public static String getVersion() PUBLIC: Return the EclipseLink version.
| |
| isConnectionHealthValidatedOnError | back to summary |
|---|---|
| public boolean isConnectionHealthValidatedOnError() Implements org. PUBLIC: This value defaults to false when not on a DatabaseLogin as the functionality has not been implemented for other datasource type. On an SQL Exception EclipseLink will ping the database to determine if the connection used can continue to be used for queries. This should have no impact on applications unless the user is using pessimistic locking queries with 'no wait' or are using a query timeout feature. If that is the case and the application is experiencing a performance impact from the health check then this feature can be turned off. Turning this feature off will prevent EclipseLink from being able to retry queries in the case of database failure.
| |
| prepareProperties | back to summary |
|---|---|
| private Properties prepareProperties(Session session) SECURE: The password in the login properties is encrypted. Return a clone of the properties with the password decrypted. Also adds platform-specific properties needed for proper functioning.
| |
| removeAllSequences | back to summary |
|---|---|
| public void removeAllSequences() Remove all sequences but the default one. | |
| removeProperty | back to summary |
|---|---|
| public void removeProperty(String propertyName) PUBLIC: Some drivers don't like the "user" and "password" properties. They can be removed with this method, or by using setUserName(null) / setPassword(null) | |
| removeSequence | back to summary |
|---|---|
| public Sequence removeSequence(String seqName) Remove sequence corresponding to name. Doesn't remove default sequence. Don't use if the session is connected. | |
| setCacheTransactionIsolation | back to summary |
|---|---|
| public void setCacheTransactionIsolation(int cacheTransactionIsolation) ADVANCED: By default concurrency is optimized and the cache is not locked more than required during reads or writes, This allows for virtual concurrent reading and writing and should never cause any problems. If the application uses no form of locking the last unit of work to merge changes will win, with no locking it is possible only under this scenario for two unit of works to merge changes different than the database although highly unlikely and if occurred is the entire purpose of locking and locking is the suggested solution if this is a problem. This property allows for the isolation level of changes to the cache to be configured for sever situations and it is not suggest that this be changed. Setting are:
| |
| setConnector | back to summary |
|---|---|
| public void setConnector(Connector connector) PUBLIC:
Set the connector that will instantiate the connection.
As an example, to use a JNDI-supplied
where the context is an instance of a javax.naming.Context and
the dataSourceName refers to the name of the DataSource
within the context.
| |
| setDatasourcePlatform | back to summary |
|---|---|
| public void setDatasourcePlatform(Platform platform) Implements org. PUBLIC: Set the database platform specific information. This allows EclipseLink to configure certain advanced features for the database desired.
| |
| setDefaultNullValue | back to summary |
|---|---|
| public void setDefaultNullValue(Class<?> type, Object value) PUBLIC: The default value to substitute for database NULLs can be configured on a per-class basis. Example: login.setDefaultNullValue(long.class, Long.valueOf(0)) | |
| setDefaultSequence | back to summary |
|---|---|
| public void setDefaultSequence(Sequence sequence) Set default sequence | |
| setEncryptedPassword | back to summary |
|---|---|
| public void setEncryptedPassword(String password) Set the encrypted password. | |
| setEncryptionClassName | back to summary |
|---|---|
| public void setEncryptionClassName(String encryptionClassName) Sets the encryption class name | |
| setPassword | back to summary |
|---|---|
| public void setPassword(String password) Implements org. Set the password.
| |
| setPlatform | back to summary |
|---|---|
| public void setPlatform(Platform platform) Implements org. INTERNAL: Set the database platform specific information. This allows EclipseLink to configure certain advanced features for the database desired.
| |
| setPlatformClassName | back to summary |
|---|---|
| public void setPlatformClassName(String platformClassName) throws ValidationException INTERNAL: Set the name of the Platform to be used. Creates a new instance of the specified Class. | |
| setPlatformClassName | back to summary |
|---|---|
| public void setPlatformClassName(String platformClassName, ClassLoader loader) throws ValidationException INTERNAL: Set the name of the Platform to be created using the passed in class loader. If no class loader is passed in, of if an exception is thrown, call the setPlatformClassName method with no classloader. | |
| setProperties | back to summary |
|---|---|
| public void setProperties(Properties properties) Implements org. PUBLIC: The properties are additional, driver-specific, connection information to be passed to the JDBC driver.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(String propertyName, Object propertyValue) Implements org. PUBLIC: Some JDBC drivers require additional, driver-specific, properties. Add the specified property to those to be passed to the JDBC driver.
| |
| setSequences | back to summary |
|---|---|
| public void setSequences(Map<String, Sequence> sequences) INTERNAL: Used only for reading the login from XML. | |
| setTableQualifier | back to summary |
|---|---|
| public void setTableQualifier(String qualifier) PUBLIC: Set the default qualifier for all tables. This can be the creator of the table or database name the table exists on. This is required by some databases such as Oracle and DB2. | |
| setTimestampQuery | back to summary |
|---|---|
| public void setTimestampQuery(ValueReadQuery timestampQuery) PUBLIC: Override the default query for returning a timestamp from the server. | |
| setUserName | back to summary |
|---|---|
| public void setUserName(String name) Implements org. PUBLIC: The user name is the database login name. Some databases do not require a user name or the user is obtained from the OS, in this case this should not be specified.
| |
| setUsesExternalConnectionPooling | back to summary |
|---|---|
| public void setUsesExternalConnectionPooling(boolean usesExternalConnectionPooling) PUBLIC: Return whether EclipseLink uses some external connection pooling service such as a JDBC 2.0 driver. | |
| setUsesExternalTransactionController | back to summary |
|---|---|
| public void setUsesExternalTransactionController(boolean usesExternalTransactionController) PUBLIC: Return whether EclipseLink uses some external transaction service such as JTS. | |
| shouldAllowConcurrentReadWrite | back to summary |
|---|---|
| public boolean shouldAllowConcurrentReadWrite() Implements org. INTERNAL: Used for cache isolation.
| |
| shouldSynchronizedReadOnWrite | back to summary |
|---|---|
| public boolean shouldSynchronizedReadOnWrite() Implements org. INTERNAL: Used for cache isolation.
| |
| shouldSynchronizeObjectLevelReadWrite | back to summary |
|---|---|
| public boolean shouldSynchronizeObjectLevelReadWrite() Implements org. INTERNAL: Used for Cache Isolation. Causes EclipseLink to lock at the object level on cache updates and cache access.
| |
| shouldSynchronizeObjectLevelReadWriteDatabase | back to summary |
|---|---|
| public boolean shouldSynchronizeObjectLevelReadWriteDatabase() Implements org. INTERNAL: Used for Cache Isolation. Causes EclipseLink to lock at the object level on cache updates and cache access, based on database transaction.
| |
| shouldSynchronizeWrites | back to summary |
|---|---|
| public boolean shouldSynchronizeWrites() Implements org. INTERNAL: Used for Cache Isolation. Causes EclipseLink to lock at the class level on cache updates.
| |
| shouldUseExternalConnectionPooling | back to summary |
|---|---|
| public boolean shouldUseExternalConnectionPooling() Implements org. PUBLIC: Return whether EclipseLink uses some external connection pooling (e.g. WebLogic's JTS driver).
| |
| shouldUseExternalTransactionController | back to summary |
|---|---|
| public boolean shouldUseExternalTransactionController() Implements org. PUBLIC: Return whether EclipseLink uses some external transaction service such as JTS.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. PUBLIC: Print all of the connection information.
| |
| useExternalConnectionPooling | back to summary |
|---|---|
| public void useExternalConnectionPooling() PUBLIC: Use external connection pooling. | |
| useExternalTransactionController | back to summary |
|---|---|
| public void useExternalTransactionController() PUBLIC: Use an external transaction controller such as a JTS service | |
| usePlatform | back to summary |
|---|---|
| public void usePlatform(Platform platform) ADVANCED: Set the database platform to be custom platform. | |