fr.gouv.culture.sdx.repository
Class JDBCRepositoryConnection

java.lang.Object
  extended byfr.gouv.culture.sdx.repository.AbstractRepositoryConnection
      extended byfr.gouv.culture.sdx.repository.JDBCRepositoryConnection
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, RepositoryConnection

public class JDBCRepositoryConnection
extends AbstractRepositoryConnection

This classes represents a SQL Connection to JDBC Source


Field Summary
 
Fields inherited from class fr.gouv.culture.sdx.repository.AbstractRepositoryConnection
logger
 
Constructor Summary
JDBCRepositoryConnection(org.apache.avalon.excalibur.datasource.DataSourceComponent dataSource)
          Creates a connection using a standard SQL Connection.
 
Method Summary
 void commit()
          Commit all pending operations within this active connection.
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
          Set's the logger for this connection.
 java.sql.Connection getConnection()
          Returns the SQL connection to the datasource component
 org.apache.avalon.excalibur.datasource.DataSourceComponent getDataSource()
          Returns the datasource component from which this connection was derived
protected  void releaseSqlConnection()
          Releases the SQL Connection to the datasource
 void rollback()
          Undo all pending operations within with this connection.
 void setAutoCommit(boolean autoCommit)
          Sets this connection in autocommit mode or not.
 
Methods inherited from class fr.gouv.culture.sdx.repository.AbstractRepositoryConnection
optimize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCRepositoryConnection

public JDBCRepositoryConnection(org.apache.avalon.excalibur.datasource.DataSourceComponent dataSource)
                         throws java.sql.SQLException
Creates a connection using a standard SQL Connection.

Parameters:
dataSource - The component from cocoon representing the database
Method Detail

commit

public void commit()
            throws SDXException
Commit all pending operations within this active connection.

Specified by:
commit in interface RepositoryConnection
Overrides:
commit in class AbstractRepositoryConnection
Throws:
SDXException

rollback

public void rollback()
              throws SDXException
Undo all pending operations within with this connection.

Specified by:
rollback in interface RepositoryConnection
Overrides:
rollback in class AbstractRepositoryConnection
Throws:
SDXException

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws SDXException
Sets this connection in autocommit mode or not.

Specified by:
setAutoCommit in interface RepositoryConnection
Overrides:
setAutoCommit in class AbstractRepositoryConnection
Parameters:
autoCommit - true enables auto-commit ; false disables auto-commit.
Throws:
SDXException

getConnection

public java.sql.Connection getConnection()
Returns the SQL connection to the datasource component


getDataSource

public org.apache.avalon.excalibur.datasource.DataSourceComponent getDataSource()
Returns the datasource component from which this connection was derived


enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Set's the logger for this connection.

Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled
Overrides:
enableLogging in class AbstractRepositoryConnection
Parameters:
logger - The logger to use.

releaseSqlConnection

protected void releaseSqlConnection()
                             throws SDXException
Releases the SQL Connection to the datasource

Throws:
SDXException


Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.