Package org.apache.log4j.db
Interface ConnectionSource
-
- All Superinterfaces:
Component,org.apache.log4j.spi.OptionHandler
- All Known Implementing Classes:
ConnectionSourceSkeleton,DataSourceConnectionSource,DriverManagerConnectionSource,JNDIConnectionSource
public interface ConnectionSource extends Component, org.apache.log4j.spi.OptionHandler
TheConnectionSourceinterface provides a pluggable means of transparently obtaining JDBCConnections for log4j classes that require the use of aConnection.- Author:
- Ray DeCampo
-
-
Field Summary
Fields Modifier and Type Field Description static intHSQL_DIALECTstatic intMSSQL_DIALECTstatic intMYSQL_DIALECTstatic intORACLE_DIALECTstatic intPOSTGRES_DIALECTstatic intUNKNOWN_DIALECT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConnectiongetConnection()Obtain aConnectionfor use.intgetSQLDialectCode()Get the SQL dialect that should be used for this connection.booleansupportsBatchUpdates()If the connection does not support batch updates, we will avoid using them.booleansupportsGetGeneratedKeys()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
-
-
-
-
Field Detail
-
UNKNOWN_DIALECT
static final int UNKNOWN_DIALECT
- See Also:
- Constant Field Values
-
POSTGRES_DIALECT
static final int POSTGRES_DIALECT
- See Also:
- Constant Field Values
-
MYSQL_DIALECT
static final int MYSQL_DIALECT
- See Also:
- Constant Field Values
-
ORACLE_DIALECT
static final int ORACLE_DIALECT
- See Also:
- Constant Field Values
-
MSSQL_DIALECT
static final int MSSQL_DIALECT
- See Also:
- Constant Field Values
-
HSQL_DIALECT
static final int HSQL_DIALECT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConnection
Connection getConnection() throws SQLException
Obtain aConnectionfor use. The client is responsible for closing theConnectionwhen it is no longer required.- Throws:
SQLException- if aConnectioncould 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.
-
-