fr.gouv.culture.sdx.repository
Class JDBCRepositoryConnection
java.lang.Object
fr.gouv.culture.sdx.utils.AbstractSdxObject
fr.gouv.culture.sdx.repository.AbstractRepositoryConnection
fr.gouv.culture.sdx.repository.JDBCRepositoryConnection
- All Implemented Interfaces:
- RepositoryConnection, Describable, Encodable, Identifiable, Localizable, SdxObject, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.excalibur.xml.sax.XMLizable
public class JDBCRepositoryConnection
- extends AbstractRepositoryConnection
This classes represents a SQL Connection to JDBC Source
Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized |
Method Summary |
void |
commit()
Commit all pending operations within this active 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.utils.AbstractSdxObject |
configure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResources |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
enableLogging |
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
- Throws:
java.sql.SQLException
JDBCRepositoryConnection
public JDBCRepositoryConnection(java.sql.Connection conn)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
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
releaseSqlConnection
protected void releaseSqlConnection()
throws SDXException
- Releases the SQL Connection to the datasource
- Throws:
SDXException
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.