Class ConnectionSourceSkeleton
java.lang.Object
org.apache.log4j.component.spi.ComponentBase
org.apache.log4j.receivers.db.ConnectionSourceSkeleton
- All Implemented Interfaces:
Component, ConnectionSource, org.apache.log4j.spi.OptionHandler
- Direct Known Subclasses:
DataSourceConnectionSource, DriverManagerConnectionSource, JNDIConnectionSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate Booleanprivate Stringprivate booleanprivate booleanprivate StringFields inherited from class ComponentBase
repositoryFields inherited from interface ConnectionSource
HSQL_DIALECT, MSSQL_DIALECT, MYSQL_DIALECT, ORACLE_DIALECT, POSTGRES_DIALECT, UNKNOWN_DIALECT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidLearn relevant information about this connection source.Returns the "overridden" value of "supportsGetGeneratedKeys" property of the JDBC driver.final StringGet the password for this connection source.final intGet the SQL dialect that should be used for this connection.final StringgetUser()Get the user for this connection source.voidsetOverriddenSupportsGetGeneratedKeys(String overriddenSupportsGetGeneratedKeys) Sets the "overridden" value of "supportsGetGeneratedKeys" property of the JDBC driver.final voidsetPassword(String password) Sets the password.final voidSets the username.final booleanDoes this connection support batch updates?final booleanDoes this connection support the JDBC Connection.getGeneratedKeys method?Methods inherited from class ComponentBase
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepositoryMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
setLoggerRepositoryMethods inherited from interface ConnectionSource
getConnectionMethods inherited from interface org.apache.log4j.spi.OptionHandler
activateOptions
-
Field Details
-
overriddenSupportsGetGeneratedKeys
-
user
-
password
-
dialectCode
private int dialectCode -
supportsGetGeneratedKeys
private boolean supportsGetGeneratedKeys -
supportsBatchUpdates
private boolean supportsBatchUpdates
-
-
Constructor Details
-
ConnectionSourceSkeleton
public ConnectionSourceSkeleton()
-
-
Method Details
-
discoverConnnectionProperties
public void discoverConnnectionProperties()Learn relevant information about this connection source. -
supportsGetGeneratedKeys
public final boolean supportsGetGeneratedKeys()Does this connection support the JDBC Connection.getGeneratedKeys method?- Specified by:
supportsGetGeneratedKeysin interfaceConnectionSource
-
getSQLDialectCode
public final int getSQLDialectCode()Description copied from interface:ConnectionSourceGet the SQL dialect that should be used for this connection. Note that the dialect is not needed if the JDBC driver supports the getGeneratedKeys method.- Specified by:
getSQLDialectCodein interfaceConnectionSource
-
getPassword
Get the password for this connection source. -
setPassword
Sets the password.- Parameters:
password- The password to set
-
getUser
Get the user for this connection source. -
setUser
Sets the username.- Parameters:
username- The username to set
-
getOverriddenSupportsGetGeneratedKeys
Returns the "overridden" value of "supportsGetGeneratedKeys" property of the JDBC driver. In certain cases, getting (e.g. Oracle 10g) generated keys does not work because it returns the ROWID, not the value of the sequence.- Returns:
- A non null string, with "true" or "false" value, if overridden,
nullif not overridden.
-
setOverriddenSupportsGetGeneratedKeys
Sets the "overridden" value of "supportsGetGeneratedKeys" property of the JDBC driver. In certain cases, getting (e.g. Oracle 10g) generated keys does not work because it returns the ROWID, not the value of the sequence.- Parameters:
overriddenSupportsGetGeneratedKeys- A non null string, with "true" or "false" value, if overridden,nullif not overridden.
-
supportsBatchUpdates
public final boolean supportsBatchUpdates()Does this connection support batch updates?- Specified by:
supportsBatchUpdatesin interfaceConnectionSource
-