Logback API
Version 0.9.8

ch.qos.logback.core.db
Interface ConnectionSource

All Superinterfaces:
LifeCycle
All Known Implementing Classes:
ConnectionSourceBase, DataSourceConnectionSource, DriverManagerConnectionSource, JNDIConnectionSource

public interface ConnectionSource
extends LifeCycle

The ConnectionSource interface provides a pluggable means of transparently obtaining JDBC Connections for logback classes that require the use of a Connection. For more information about this component, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#DBAppender

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 ch.qos.logback.core.spi.LifeCycle
isStarted, start, stop
 

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 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

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.


Logback API
Version 0.9.8

Copyright © 2005-2008 QOS.ch. All Rights Reserved.