Top Description Fields Constructors Methods
org.eclipse.persistence.sessions

public Class DatabaseLogin

extends DatasourceLogin
Class Inheritance
Imports
java.io.*, java.sql.Connection, org.eclipse.persistence.internal.databaseaccess.Accessor, .DatabaseAccessor, .DatabaseCall, .Platform, org.eclipse.persistence.internal.localization.*, org.eclipse.persistence.platform.database.*, org.eclipse.persistence.platform.database.converters.StructConverter, org.eclipse.persistence.platform.database.partitioning.DataPartitioningCallback, org.eclipse.persistence.sequencing.NativeSequence, org.eclipse.persistence.exceptions.*

Purpose: Hold the configuration information necessary to connect to a JDBC driver.

Description: A DatabaseLogin is used by an EclipseLink database session to connect to a JDBC server.

Responsibilities:

Field Summary

Modifier and TypeField and Description
protected Boolean
connectionHealthValidatedOnError

On an SQL Exception EclipseLink will ping the database to determine if the connection used can continue to be used for queries.

protected int
delayBetweenConnectionAttempts

Stores the number of milliseconds that EclipseLink will wait between attempts to reconnect a DatabaseConnection in the case EclipseLink is attempting to retry a query.

protected int
queryRetryAttemptCount

Stores the value for the number of time EclipseLink will attempt to reconnect the connection on a comm failure in the case EclipseLink is attempting to retry a query.

public static final int
TRANSACTION_NONE

Transactions are not supported.

public static final int
TRANSACTION_READ_COMMITTED

Dirty reads are prevented; non-repeatable reads and phantom reads can occur.

public static final int
TRANSACTION_READ_UNCOMMITTED

Dirty reads, non-repeatable reads and phantom reads can occur.

public static final int
TRANSACTION_REPEATABLE_READ

Dirty reads and non-repeatable reads are prevented; phantom reads can occur.

public static final int
TRANSACTION_SERIALIZABLE

Dirty reads, non-repeatable reads and phantom reads are prevented.

Inherited from org.eclipse.persistence.sessions.DatasourceLogin:
cacheTransactionIsolationCONCURRENT_READ_WRITEconnectorplatformpropertiesSYNCHRONIZED_READ_ON_WRITESYNCHRONIZED_WRITESYNCRONIZED_OBJECT_LEVEL_READ_WRITESYNCRONIZED_OBJECT_LEVEL_READ_WRITE_DATABASEusesExternalConnectionPoolingusesExternalTransactionControllerversionString

Constructor Summary

AccessConstructor and Description
public
DatabaseLogin()

PUBLIC: Create a new login.

public
DatabaseLogin(DatabasePlatform databasePlatform)

ADVANCED: Create a new login for the given platform.

Method Summary

Modifier and TypeMethod and Description
public void
addStructConverter(StructConverter converter)

ADVANCED: Add a StructConverter

public void
bindAllParameters()

PUBLIC: Bind all arguments to any SQL statement.

public Accessor
buildAccessor()

Implements org.eclipse.persistence.sessions.Login.buildAccessor.

INTERNAL: Build and return an appropriate Accessor.
public void
cacheAllStatements()

PUBLIC: Cache all prepared statements, this requires full parameter binding as well.

public void
dontBindAllParameters()

PUBLIC: Do not bind all arguments to any SQL statement.

public void
dontCacheAllStatements()

PUBLIC: Do not cache all prepared statements.

public void
dontOptimizeDataConversion()

PUBLIC: Disable driver level data conversion optimization.

public void
dontUseBatchWriting()

PUBLIC: EclipseLink can be configured to use batch writing.

public void
dontUseByteArrayBinding()

PUBLIC: EclipseLink can be configured to use parameter binding for large binary data.

public void
dontUseJDBCBatchWriting()

PUBLIC: Indicate to EclipseLink that the JDBC driver does not support batch writing.

public void
dontUseNativeSQL()

PUBLIC: EclipseLink can be configured to use database-specific SQL grammar, as opposed to the JDBC standard grammar.

public void
dontUseStreamsForBinding()

PUBLIC: EclipseLink can be configured to use streams to store large binary data.

public void
dontUseStringBinding()

PUBLIC: Do not bind strings of any size.

protected boolean
driverIs(String driverName)

INTERNAL: Return whether the specified driver is being used.

public String
getConnectionString()

PUBLIC: Return the JDBC connection string.

public int
getCursorCode()

ADVANCED: Return the code for preparing cursored output parameters in a stored procedure

public String
getDatabaseName()

PUBLIC: The database name is required when connecting to databases that support multiple databases within a single server instance (e.g. Sybase, SQL Server).

public String
getDatabaseURL()

PUBLIC: The database URL is the JDBC URL for the database server.

public String
getDataSourceName()

PUBLIC: The data source name is required if connecting through ODBC (JDBC-ODBC, etc.).

public Platform
protected DefaultConnector
getDefaultConnector()

INTERNAL: Return the connector that will instantiate the java.sql.Connection.

public int
getDelayBetweenConnectionAttempts()

PUBLIC: Returns the number of milliseconds that EclipseLink will wait between attempts to reconnect a DatabaseConnection in the case EclipseLink is attempting to retry a query, the default is 5000.

public String
getDriverClassName()

PUBLIC: The driver class is the name of the Java class for the JDBC driver being used (e.g. "sun.jdbc.odbc.JdbcOdbcDriver").

public String
getDriverURLHeader()

PUBLIC: The driver URL header is the string predetermined by the JDBC driver to be part of the URL connection string, (e.g. "jdbc:odbc:").

public int
getMaxBatchWritingSize()

PUBLIC: Allow for the max batch writing size to be set.

public DataPartitioningCallback
getPartitioningCallback()

PUBLIC: Return callback.

public String
getPingSQL()

PUBLIC: EclipseLink will attempt to test a connection if it encounters an exception on the connection when executing SQL.

public int
getQueryRetryAttemptCount()

PUBLIC: Return the number of attempts EclipseLink should make to re-connect to a database and re-execute a query after a query has failed because of a communication issue.

public String
getServerName()

PUBLIC: The server name is the name of the database instance.

public boolean
getShouldBindAllParameters()

PUBLIC: Used to help bean introspection.

public boolean
getShouldCacheAllStatements()

PUBLIC: Used to help bean introspection.

public boolean
getShouldOptimizeDataConversion()

PUBLIC: Used to help bean introspection.

public boolean
getShouldTrimStrings()

PUBLIC: Used to help bean introspection.

public int
getStatementCacheSize()

PUBLIC: If prepared statement caching is used, return the cache size.

public int
getStringBindingSize()

PUBLIC: Used to help bean introspection.

public String
getTableCreationSuffix()

PUBLIC: Get the String used on all table creation statements generated from the DefaultTableGenerator with a session using this project (DDL generation).

public int
getTransactionIsolation()

PUBLIC: Return the transaction isolation setting for the connection.

public String
getURL()

PUBLIC: Return the JDBC URL.

public boolean
getUsesBinding()

PUBLIC: Used to help bean introspection.

public boolean
getUsesNativeSequencing()

PUBLIC: Used to help bean introspection.

public boolean
getUsesNativeSQL()

PUBLIC: Used to help bean introspection.

public boolean
getUsesStreamsForBinding()

PUBLIC: Used to help bean introspection.

public boolean
getUsesStringBinding()

PUBLIC: Used to help bean introspection.

public void
handleTransactionsManuallyForSybaseJConnect()

PUBLIC: Force EclipseLink to manually begin transactions instead of using autoCommit.

public boolean
isAnyOracleJDBCDriver()

PUBLIC: Return whether an Oracle JDBC driver is being used.

public boolean
isCloudscapeJDBCDriver()

PUBLIC: Return whether a Cloudscape JDBC driver is being used.

public boolean
isConnectionHealthValidatedOnError(DatabaseCall call, DatabaseAccessor accessor)

INTERNAL: Validate if set, or no timeout.

public boolean
isConnectionHealthValidatedOnError()

Overrides org.eclipse.persistence.sessions.DatasourceLogin.isConnectionHealthValidatedOnError.

Implements org.eclipse.persistence.sessions.Login.isConnectionHealthValidatedOnError.

PUBLIC: On an SQL Exception EclipseLink will ping the database to determine if the connection used can continue to be used for queries.
public boolean
isDB2JDBCDriver()

PUBLIC: Return whether an IBM DB2 native client JDBC driver is being used.

public boolean
isIntersolvSequeLinkDriver()

PUBLIC: Return whether an Intersolv SeqeLink JDBC driver is being used.

public boolean
isJConnectDriver()

PUBLIC: Return whether a Sybase JConnect JDBC driver is being used.

public boolean
isJDBCConnectDriver()

PUBLIC: Return whether a Borland JDBCConnect JDBC driver is being used.

public boolean
isJDBCConnectRemoteDriver()

PUBLIC: Return whether a Borland JDBCConnect JDBC driver is being used.

public boolean
isJDBCODBCBridge()

PUBLIC: Return whether a Sun/Merant JDBC-ODBC bridge driver is being used.

public boolean
isOracle7JDBCDriver()

PUBLIC: Return whether an Oracle native 7.x OCI JDBC driver is being used.

public boolean
isOracleJDBCDriver()

PUBLIC: Return whether an Oracle 8.x native OCI JDBC driver is being used.

public boolean
isOracleServerJDBCDriver()

PUBLIC: Return whether an Oracle thin JDBC driver is being used.

public boolean
isOracleThinJDBCDriver()

PUBLIC: Return whether an Oracle thin JDBC driver is being used.

public boolean
isWebLogicOracleOCIDriver()

PUBLIC: Return whether a WebLogic Oracle OCI JDBC driver is being used.

public boolean
isWebLogicSQLServerDBLibDriver()

PUBLIC: Return whether a WebLogic SQL Server dblib JDBC driver is being used.

public boolean
isWebLogicSQLServerDriver()

PUBLIC: Return whether a WebLogic SQL Server JDBC driver is being used.

public boolean
isWebLogicSybaseDBLibDriver()

PUBLIC: Return whether a WebLogic Sybase dblib JDBC driver is being used.

public boolean
isWebLogicThinClientDriver()

PUBLIC: Return whether a WebLogic thin client JDBC driver is being used.

public boolean
isWebLogicThinDriver()

PUBLIC: Return whether a WebLogic thin JDBC driver is being used.

public void
optimizeDataConversion()

PUBLIC: Enable driver level data conversion optimization.

protected boolean
oracleDriverIs(String urlPrefix)

INTERNAL: Return whether the specified Oracle JDBC driver is being used.

public void
setConnectionHealthValidatedOnError(boolean isConnectionHealthValidatedOnError)

PUBLIC: On an SQL Exception EclipseLink will ping the database to determine if the connection used can continue to be used for queries.

public void
setConnectionString(String url)

PUBLIC: Set the JDBC connection string.

public void
setCursorCode(int cursorCode)

ADVANCED: Set the code for preparing cursored output parameters in a stored procedure

public void
setDatabaseName(String databaseName)

PUBLIC: The database name is required when connecting to databases that support multiple databases within a single server instance (e.g. Sybase, SQL Server).

public void
setDatabaseURL(String databaseURL)

PUBLIC: The database URL is the JDBC URL for the database server.

public void
setDefaultNullValue(Class<?> type, Object value)

Overrides org.eclipse.persistence.sessions.DatasourceLogin.setDefaultNullValue.

PUBLIC: The default value to substitute for database NULLs can be configured on a per-class basis.
public void
setDelayBetweenConnectionAttempts(int delayBetweenConnectionAttempts)

PUBLIC: Stores the number of milliseconds that EclipseLink will wait between attempts to reconnect a DatabaseConnection in the case EclipseLink is attempting to retry a query.

public void
setDriverClass(Class<?> driverClass)

PUBLIC: The driver class is the Java class for the JDBC driver to be used (e.g. sun.jdbc.odbc.JdbcOdbcDriver.class).

public void
setDriverClassName(String driverClassName)

PUBLIC: The name of the JDBC driver class to be used (e.g. "sun.jdbc.odbc.JdbcOdbcDriver").

public void
setDriverURLHeader(String driverURLHeader)

PUBLIC: The driver URL header is the string predetermined by the JDBC driver to be part of the URL connection string, (e.g. "jdbc:odbc:").

public void
setMaxBatchWritingSize(int maxBatchWritingSize)

PUBLIC: Allow for the max batch writing size to be set.

public void
setODBCDataSourceName(String dataSourceName)

PUBLIC: The data source name is required if connecting through ODBC (JDBC-ODBC, etc.).

public void
setPartitioningCallback(DataPartitioningCallback partitioningCallback)

PUBLIC: Set callback.

public void
setPingSQL(String pingSQL)

PUBLIC: EclipseLink will attempt to test a connection if it encounters an exception on the connection when executing SQL.

public void
setQueryRetryAttemptCount(int queryRetryAttemptCount)

PUBLIC: Set the number of attempts EclipseLink should make to re-connect to a database and re-execute a query after a query has failed because of a communication issue.

public void
setServerName(String name)

PUBLIC: The server name is the name of the database instance.

public void
setShouldBindAllParameters(boolean shouldBindAllParameters)

PUBLIC: Set whether to bind all arguments to any SQL statement.

public void
setShouldCacheAllStatements(boolean shouldCacheAllStatements)

PUBLIC: Set whether prepared statements should be cached.

public void
setShouldCreateIndicesOnForeignKeys(boolean shouldCreateIndicesOnForeignKeys)

PUBLIC: Used for table creation.

public void
setShouldForceFieldNamesToUpperCase(boolean shouldForceFieldNamesToUpperCase)

ADVANCED: This setting can be used if the application expects upper case but the database does not return consistent case (e.g. different databases).

public static void
setShouldIgnoreCaseOnFieldComparisons(boolean shouldIgnoreCaseOnFieldComparisons)

ADVANCED: Allow for case in field names to be ignored as some databases are not case sensitive.

public void
setShouldOptimizeDataConversion(boolean value)

PUBLIC: Set whether driver level data conversion optimization is enabled.

public void
setShouldTrimStrings(boolean shouldTrimStrings)

PUBLIC: By default CHAR field values have trailing blanks trimmed, this can be configured.

public void
setStatementCacheSize(int size)

PUBLIC: If prepared statement caching is used this configures the cache size.

public void
setStringBindingSize(int stringBindingSize)

PUBLIC: Used to help bean introspection.

public void
setTableCreationSuffix(String tableCreationSuffix)

PUBLIC: Get the String used on all table creation statements generated from the DefaultTableGenerator with a session using this project (DDL generation).

public void
setTableQualifier(String qualifier)

Overrides org.eclipse.persistence.sessions.DatasourceLogin.setTableQualifier.

PUBLIC: Set the default qualifier for all tables.
public void
setTransactionIsolation(int isolationLevel)

PUBLIC: Set the transaction isolation setting for the connection.

public void
setURL(String url)

PUBLIC: Set the JDBC URL.

public void
setUsesBatchWriting(boolean value)

PUBLIC: EclipseLink can be configured to use batch writing.

public void
setUsesByteArrayBinding(boolean value)

PUBLIC: EclipseLink can be configured to use parameter binding for large binary data.

public void
setUsesJDBCBatchWriting(boolean
boolean true delegates batch writing to the JDBC driver and false delegates batch writing to EclipseLink.
usesJDBCBatchWriting
)

PUBLIC: Calling this method with an argument of true indicates to EclipseLink that the JDBC driver supports batch writing.

public void
setUsesNativeSQL(boolean value)

PUBLIC: EclipseLink can be configured to use database specific sql grammar not JDBC specific.

public void
setUsesStreamsForBinding(boolean value)

PUBLIC: EclipseLink can be configured to use streams to store large binary data.

public void
setUsesStringBinding(boolean usesStringBindingSize)

PUBLIC: Used to help bean introspection.

public boolean
shouldBindAllParameters()

PUBLIC: Bind all arguments to any SQL statement.

public boolean
shouldCacheAllStatements()

PUBLIC: Cache all prepared statements, this requires full parameter binding as well.

public boolean

Returns:

whether an index should be created explicitly for foreign key constraints
shouldCreateIndicesOnForeignKeys
()

PUBLIC: Used for table creation.

public boolean
shouldForceFieldNamesToUpperCase()

ADVANCED: Can be used if the app expects upper case but the database is not return consistent case, i.e. different databases.

public static boolean
shouldIgnoreCaseOnFieldComparisons()

ADVANCED: Allow for case in field names to be ignored as some databases are not case sensitive.

public boolean
shouldOptimizeDataConversion()

PUBLIC: Return if our driver level data conversion optimization is enabled.

public boolean
shouldTrimStrings()

PUBLIC: By default CHAR field values have trailing blanks trimmed, this can be configured.

public boolean
shouldUseBatchWriting()

PUBLIC: EclipseLink can be configured to use batch writing.

public boolean
shouldUseByteArrayBinding()

PUBLIC: EclipseLink can be configured to use parameter binding for large binary data.

public boolean

Returns:

boolean true if batch writing is delegated to the JDBC driver. Returns false if delegated to EclipseLink.
shouldUseJDBCBatchWriting
()

PUBLIC: Answers true if EclipseLink has JDBC batch writing enabled.

public boolean
shouldUseNativeSequencing()

PUBLIC: EclipseLink can be configured to use a sequence table or native sequencing to generate unique object IDs.

public boolean
shouldUseNativeSQL()

PUBLIC: EclipseLink can be configured to use database-specific SQL grammar, as opposed to the JDBC standard grammar.

public boolean
shouldUseStreamsForBinding()

PUBLIC: EclipseLink can be configured to use streams to store large binary data.

public boolean
shouldUseStringBinding()

PUBLIC: EclipseLink can be configured to bind large strings.

public String
toString()

Overrides org.eclipse.persistence.sessions.DatasourceLogin.toString.

PUBLIC: Print all of the connection information.
public void
useAccess()

PUBLIC: Set the database platform to be Access.

public void
useBatchWriting()

PUBLIC: EclipseLink can be configured to use batch writing.

public void
useByteArrayBinding()

PUBLIC: EclipseLink can be configured to use parameter binding for large binary data.

public void
useCloudscape()

PUBLIC: Set the database platform to be Cloudscape.

public void
useCloudscapeDriver()

PUBLIC: Use the Cloudscape JDBC driver.

public void
useDataSource(String dataSource)

PUBLIC: Specify the J2EE DataSource name to connect to.

public void
useDB2()

PUBLIC: Set the database platform to be DB2.

public void
useDB2JDBCDriver()

PUBLIC: Use the IBM DB2 native client interface.

public void
useDB2NetJDBCDriver()

PUBLIC: Use the IBM DB2 thin JDBC driver.

public void
useDBase()

PUBLIC: Set the database platform to be DBase.

public void
useDefaultDriverConnect()

PUBLIC: Connect to the JDBC driver via DriverManager.

public void
useDefaultDriverConnect(String driverClassName, String driverURLHeader, String databaseURL)

PUBLIC: Connect to the JDBC driver via DriverManager.

public void
public void
useDirectDriverConnect()

PUBLIC: Some JDBC drivers don't support connecting correctly (via DriverManager), but do support connecting incorrectly (e.g. Castanet).

public void
useDirectDriverConnect(String driverClassName, String driverURLHeader, String databaseURL)

PUBLIC: Some JDBC drivers don't support connecting correctly (via DriverManager), but do support connecting incorrectly (e.g. Castanet).

public void
useExternalConnectionPooling()

Overrides org.eclipse.persistence.sessions.DatasourceLogin.useExternalConnectionPooling.

PUBLIC: Use external connection pooling, such as WebLogic's JTS driver.
public void
useExternalTransactionController()

Overrides org.eclipse.persistence.sessions.DatasourceLogin.useExternalTransactionController.

PUBLIC: Use an external transaction controller such as a JTS service
public void
useHSQL()

PUBLIC: Use the HSQL JDBC driver.

public void
useHSQLDriver()

PUBLIC: Use the HSQL JDBC driver.

public void
useINetSQLServerDriver()

PUBLIC: Use the i-net SQL Server JDBC driver.

public void
useInformix()

PUBLIC: Set the database platform to be Informix.

public void
useIntersolvSequeLinkDriver()

PUBLIC: Use the Intersolv/Merant SequeLink JDBC driver.

public void
useJConnect50Driver()

PUBLIC: Use the Sybase JConnect JDBC driver.

public void
useJConnectDriver()

PUBLIC: Use the Sybase JConnect JDBC driver.

public void
useJDBC()

PUBLIC: Set the database platform to be JDBC.

public void
useJDBCBatchWriting()

PUBLIC: EclipseLink support batch writing in both JDK 1.1 abd JDK 1.2.

public void
useJDBCConnectDriver()

PUBLIC: Use the Borland JDBCConnect JDBC driver.

public void
useJDBCConnectRemoteDriver()

PUBLIC: Use the Borland JDBCConnect JDBC driver.

public void
useJDBCODBCBridge()

PUBLIC: User the Sun/Merant JDBC-ODBC bridge driver.

public void
useJTADataSource(String dataSource)

PUBLIC: Specify the J2EE JTA enabled DataSource name to connect to.

public void
useMySQL()

PUBLIC: Set the database platform to be MySQL.

public void
useNativeSequencing()

PUBLIC: EclipseLink can be configured to use a sequence table or native sequencing to generate unique object IDs.

public void
useNativeSQL()

PUBLIC: EclipseLink can be configured to use database-specific SQL grammar, as opposed to the JDBC standard grammar.

public void
useOracle()

PUBLIC: Set the database platform to be Oracle.

public void
useOracle7JDBCDriver()

PUBLIC: Use the Oracle 7.x native OCI JDBC driver.

public void
useOracleJDBCDriver()

PUBLIC: Use the Oracle 8.x native OCI JDBC driver.

public void
useOracleServerJDBCDriver()

PUBLIC: Use the Oracle server JDBC driver.

public void
useOracleThinJDBCDriver()

PUBLIC: Use the Oracle thin JDBC driver.

public void
usePlatform(DatabasePlatform platform)

ADVANCED: Set the database platform to be custom platform.

public void
usePointBase()

PUBLIC: Set the database platform to be PointBase.

public void
usePointBaseDriver()

PUBLIC: Use the PointBase JDBC driver.

public void
useSQLServer()

PUBLIC: Set the database platform to be SQL Server.

public void
useStreamsForBinding()

PUBLIC: EclipseLink can be configured to use streams to store large binary data.

public void
useStringBinding()

PUBLIC: Bind strings larger than 255 characters.

public void
useStringBinding(int size)

PUBLIC: Bind strings that are larger than the specified size.

public void
useSybase()

PUBLIC: Set the database platform to be Sybase.

public void
useSymfoware()

PUBLIC: Set the database platform to be Symfoware.

public void
useWebLogicDriverCursoredOutputCode()

PUBLIC: Set the prepare cursor code to what the WebLogic Oracle OCI JDBC driver expects.

public void
useWebLogicJDBCConnectionPool(String poolName)

PUBLIC: Set a WebLogic JDBC connection pool (a pool must be defined for the entity beans that are to be deployed)

public void
useWebLogicOracleOCIDriver()

PUBLIC: Use the WebLogic Oracle OCI JDBC driver.

public void
useWebLogicSQLServerDBLibDriver()

PUBLIC: Use the WebLogic SQL Server dblib JDBC driver.

public void
useWebLogicSQLServerDriver()

PUBLIC: Use the WebLogic SQL Server JDBC driver.

public void
useWebLogicSybaseDBLibDriver()

PUBLIC: Use the WebLogic Sybase dblib JDBC driver.

public void
useWebLogicThinClientDriver()

PUBLIC: Use the WebLogic thin client JDBC driver.

public void
useWebLogicThinDriver()

PUBLIC: Use the WebLogic thin JDBC driver.

Inherited from org.eclipse.persistence.sessions.DatasourceLogin:
addSequencecloneconnectToDatasourcedontUseExternalConnectionPoolingdontUseExternalTransactionControllergetCacheTransactionIsolationgetConnectorgetDefaultSequencegetDefaultSequenceToWritegetPasswordgetPlatformgetPlatformClassNamegetPropertiesgetPropertygetSecurableObjectHoldergetSequencegetSequencesgetSequencesToWritegetTableQualifiergetUserNamegetVersionremoveAllSequencesremovePropertyremoveSequencesetCacheTransactionIsolationsetConnectorsetDatasourcePlatformsetDefaultSequencesetEncryptedPasswordsetEncryptionClassNamesetPasswordsetPlatformsetPlatformClassNamesetPlatformClassNamesetPropertiessetPropertysetSequencessetTimestampQuerysetUserNamesetUsesExternalConnectionPoolingsetUsesExternalTransactionControllershouldAllowConcurrentReadWriteshouldSynchronizedReadOnWriteshouldSynchronizeObjectLevelReadWriteshouldSynchronizeObjectLevelReadWriteDatabaseshouldSynchronizeWritesshouldUseExternalConnectionPoolingshouldUseExternalTransactionControllerusePlatform