Package org.apache.log4j.db
Interface ConnectionSource
- All Superinterfaces:
Component
,org.apache.log4j.spi.OptionHandler
- All Known Implementing Classes:
ConnectionSourceSkeleton
,DataSourceConnectionSource
,DriverManagerConnectionSource
,JNDIConnectionSource
The
ConnectionSource
interface provides a pluggable means of
transparently obtaining JDBC Connection
s for log4j classes
that require the use of a Connection
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionObtain aConnection
for use.int
Get the SQL dialect that should be used for this connection.boolean
If the connection does not support batch updates, we will avoid using them.boolean
If the connection supports the JDBC 3.0 getGeneratedKeys method, then we do not need any specific dialect support.Methods inherited from interface org.apache.log4j.spi.Component
setLoggerRepository
Methods inherited from interface org.apache.log4j.spi.OptionHandler
activateOptions
-
Field Details
-
UNKNOWN_DIALECT
static final int UNKNOWN_DIALECT- See Also:
-
POSTGRES_DIALECT
static final int POSTGRES_DIALECT- See Also:
-
MYSQL_DIALECT
static final int MYSQL_DIALECT- See Also:
-
ORACLE_DIALECT
static final int ORACLE_DIALECT- See Also:
-
MSSQL_DIALECT
static final int MSSQL_DIALECT- See Also:
-
HSQL_DIALECT
static final int HSQL_DIALECT- See Also:
-
-
Method Details
-
getConnection
Obtain aConnection
for use. The client is responsible for closing theConnection
when it is no longer required.- Throws:
SQLException
- if aConnection
could not be obtained
-
getSQLDialectCode
int getSQLDialectCode()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. -
supportsGetGeneratedKeys
boolean supportsGetGeneratedKeys()If the connection supports the JDBC 3.0 getGeneratedKeys method, then we do not need any specific dialect support. -
supportsBatchUpdates
boolean supportsBatchUpdates()If the connection does not support batch updates, we will avoid using them.
-