Search in sources :

Example 1 with CciOperationNotSupportedException

use of org.springframework.jca.cci.CciOperationNotSupportedException in project spring-framework by spring-projects.

the class CciTemplate method execute.

@Override
public <T> T execute(ConnectionCallback<T> action) throws DataAccessException {
    Assert.notNull(action, "Callback object must not be null");
    Connection con = ConnectionFactoryUtils.getConnection(getConnectionFactory(), getConnectionSpec());
    try {
        return action.doInConnection(con, getConnectionFactory());
    } catch (NotSupportedException ex) {
        throw new CciOperationNotSupportedException("CCI operation not supported by connector", ex);
    } catch (ResourceException ex) {
        throw new DataAccessResourceFailureException("CCI operation failed", ex);
    } catch (SQLException ex) {
        throw new InvalidResultSetAccessException("Parsing of CCI ResultSet failed", ex);
    } finally {
        ConnectionFactoryUtils.releaseConnection(con, getConnectionFactory());
    }
}
Also used : CciOperationNotSupportedException(org.springframework.jca.cci.CciOperationNotSupportedException) DataAccessResourceFailureException(org.springframework.dao.DataAccessResourceFailureException) SQLException(java.sql.SQLException) Connection(javax.resource.cci.Connection) ResourceException(javax.resource.ResourceException) InvalidResultSetAccessException(org.springframework.jca.cci.InvalidResultSetAccessException) RecordTypeNotSupportedException(org.springframework.jca.cci.RecordTypeNotSupportedException) NotSupportedException(javax.resource.NotSupportedException) CciOperationNotSupportedException(org.springframework.jca.cci.CciOperationNotSupportedException)

Aggregations

SQLException (java.sql.SQLException)1 NotSupportedException (javax.resource.NotSupportedException)1 ResourceException (javax.resource.ResourceException)1 Connection (javax.resource.cci.Connection)1 DataAccessResourceFailureException (org.springframework.dao.DataAccessResourceFailureException)1 CciOperationNotSupportedException (org.springframework.jca.cci.CciOperationNotSupportedException)1 InvalidResultSetAccessException (org.springframework.jca.cci.InvalidResultSetAccessException)1 RecordTypeNotSupportedException (org.springframework.jca.cci.RecordTypeNotSupportedException)1