Package org.apache.log4j.receivers.db
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
public abstract class ConnectionSourceSkeleton extends ComponentBase implements ConnectionSource
-
-
Field Summary
Fields Modifier and Type Field Description private int
dialectCode
private java.lang.Boolean
overriddenSupportsGetGeneratedKeys
private java.lang.String
password
private boolean
supportsBatchUpdates
private boolean
supportsGetGeneratedKeys
private java.lang.String
user
-
Fields inherited from class org.apache.log4j.component.spi.ComponentBase
repository
-
Fields inherited from interface org.apache.log4j.receivers.db.ConnectionSource
HSQL_DIALECT, MSSQL_DIALECT, MYSQL_DIALECT, ORACLE_DIALECT, POSTGRES_DIALECT, UNKNOWN_DIALECT
-
-
Constructor Summary
Constructors Constructor Description ConnectionSourceSkeleton()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
discoverConnnectionProperties()
Learn relevant information about this connection source.java.lang.String
getOverriddenSupportsGetGeneratedKeys()
Returns the "overridden" value of "supportsGetGeneratedKeys" property of the JDBC driver.java.lang.String
getPassword()
Get the password for this connection source.int
getSQLDialectCode()
Get the SQL dialect that should be used for this connection.java.lang.String
getUser()
Get the user for this connection source.void
setOverriddenSupportsGetGeneratedKeys(java.lang.String overriddenSupportsGetGeneratedKeys)
Sets the "overridden" value of "supportsGetGeneratedKeys" property of the JDBC driver.void
setPassword(java.lang.String password)
Sets the password.void
setUser(java.lang.String username)
Sets the username.boolean
supportsBatchUpdates()
Does this connection support batch updates?boolean
supportsGetGeneratedKeys()
Does this connection support the JDBC Connection.getGeneratedKeys method?-
Methods inherited from class org.apache.log4j.component.spi.ComponentBase
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepository
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.log4j.component.spi.Component
setLoggerRepository
-
Methods inherited from interface org.apache.log4j.receivers.db.ConnectionSource
getConnection
-
-
-
-
Field Detail
-
overriddenSupportsGetGeneratedKeys
private java.lang.Boolean overriddenSupportsGetGeneratedKeys
-
user
private java.lang.String user
-
password
private java.lang.String password
-
dialectCode
private int dialectCode
-
supportsGetGeneratedKeys
private boolean supportsGetGeneratedKeys
-
supportsBatchUpdates
private boolean supportsBatchUpdates
-
-
Method Detail
-
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:
supportsGetGeneratedKeys
in interfaceConnectionSource
-
getSQLDialectCode
public final int getSQLDialectCode()
Description copied from interface:ConnectionSource
Get 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:
getSQLDialectCode
in interfaceConnectionSource
-
getPassword
public final java.lang.String getPassword()
Get the password for this connection source.
-
setPassword
public final void setPassword(java.lang.String password)
Sets the password.- Parameters:
password
- The password to set
-
getUser
public final java.lang.String getUser()
Get the user for this connection source.
-
setUser
public final void setUser(java.lang.String username)
Sets the username.- Parameters:
username
- The username to set
-
getOverriddenSupportsGetGeneratedKeys
public java.lang.String 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,
null
if not overridden.
-
setOverriddenSupportsGetGeneratedKeys
public void setOverriddenSupportsGetGeneratedKeys(java.lang.String overriddenSupportsGetGeneratedKeys)
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,null
if not overridden.
-
supportsBatchUpdates
public final boolean supportsBatchUpdates()
Does this connection support batch updates?- Specified by:
supportsBatchUpdates
in interfaceConnectionSource
-
-