Log4j 1.3alpha-8

org.apache.log4j.db
Interface ConnectionSource

All Superinterfaces:
Component, OptionHandler
All Known Implementing Classes:
ConnectionSourceSkeleton

public interface ConnectionSource
extends Component, OptionHandler

The ConnectionSource interface provides a pluggable means of transparently obtaining JDBC Connections for log4j classes that require the use of a Connection.

Author:
Ray DeCampo

Field Summary
static int HSQL_DIALECT
           
static int MSSQL_DIALECT
           
static int MYSQL_DIALECT
           
static int ORACLE_DIALECT
           
static int POSTGRES_DIALECT
           
static int UNKNOWN_DIALECT
           
 
Method Summary
 Connection getConnection()
          Obtain a Connection for use.
 int getSQLDialectCode()
          Get the SQL dialect that should be used for this connection.
 boolean supportsBatchUpdates()
          If the connection does not support batch updates, we will avoid using them.
 boolean supportsGetGeneratedKeys()
          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 Detail

UNKNOWN_DIALECT

public static final int UNKNOWN_DIALECT

POSTGRES_DIALECT

public static final int POSTGRES_DIALECT

MYSQL_DIALECT

public static final int MYSQL_DIALECT

ORACLE_DIALECT

public static final int ORACLE_DIALECT

MSSQL_DIALECT

public static final int MSSQL_DIALECT

HSQL_DIALECT

public static final int HSQL_DIALECT
Method Detail

getConnection

public Connection getConnection()
                         throws SQLException
Obtain a Connection for use. The client is responsible for closing the Connection when it is no longer required.
Throws:
SQLException - if a Connection could not be obtained

getSQLDialectCode

public 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

public boolean supportsGetGeneratedKeys()
If the connection supports the JDBC 3.0 getGeneratedKeys method, then we do not need any specific dialect support.

supportsBatchUpdates

public boolean supportsBatchUpdates()
If the connection does not support batch updates, we will avoid using them.

Log4j 1.3alpha-8

Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.