Added @Override and @Deprecated annotations to jdbc module

This commit is contained in:
Arjen Poutsma 2008-10-28 00:01:49 +00:00
parent aa60746155
commit cdb36efb0d
64 changed files with 123 additions and 0 deletions

View File

@ -43,6 +43,7 @@ public class CannotGetJdbcConnectionException extends DataAccessResourceFailureE
* @deprecated since Spring 2.5, in favor of throwing an * @deprecated since Spring 2.5, in favor of throwing an
* IllegalStateException in case of the driver not being found * IllegalStateException in case of the driver not being found
*/ */
@Deprecated
public CannotGetJdbcConnectionException(String msg, ClassNotFoundException ex) { public CannotGetJdbcConnectionException(String msg, ClassNotFoundException ex) {
super(msg, ex); super(msg, ex);
} }

View File

@ -62,6 +62,7 @@ public class JdbcUpdateAffectedIncorrectNumberOfRowsException extends IncorrectU
return this.actual; return this.actual;
} }
@Override
public boolean wasDataUpdated() { public boolean wasDataUpdated() {
return (getActualRowsAffected() > 0); return (getActualRowsAffected() > 0);
} }

View File

@ -229,6 +229,7 @@ public class CallableStatementCreatorFactory {
} }
} }
@Override
public String toString() { public String toString() {
StringBuffer buf = new StringBuffer("CallableStatementCreatorFactory.CallableStatementCreatorImpl: sql=["); StringBuffer buf = new StringBuffer("CallableStatementCreatorFactory.CallableStatementCreatorImpl: sql=[");
buf.append(callString).append("]; parameters=").append(this.inParameters); buf.append(callString).append("]; parameters=").append(this.inParameters);

View File

@ -311,6 +311,7 @@ public class PreparedStatementCreatorFactory {
StatementCreatorUtils.cleanupParameters(this.parameters); StatementCreatorUtils.cleanupParameters(this.parameters);
} }
@Override
public String toString() { public String toString() {
StringBuffer buf = new StringBuffer("PreparedStatementCreatorFactory.PreparedStatementCreatorImpl: sql=["); StringBuffer buf = new StringBuffer("PreparedStatementCreatorFactory.PreparedStatementCreatorImpl: sql=[");
buf.append(sql).append("]; parameters=").append(this.parameters); buf.append(sql).append("]; parameters=").append(this.parameters);

View File

@ -129,6 +129,7 @@ public class ResultSetSupportingSqlParameter extends SqlParameter {
/** /**
* <p>This implementation always returns <code>false</code>. * <p>This implementation always returns <code>false</code>.
*/ */
@Override
public boolean isInputValueProvided() { public boolean isInputValueProvided() {
return false; return false;
} }

View File

@ -105,6 +105,7 @@ public class SqlInOutParameter extends SqlOutParameter {
/** /**
* This implementation always returns <code>true</code>. * This implementation always returns <code>true</code>.
*/ */
@Override
public boolean isInputValueProvided() { public boolean isInputValueProvided() {
return true; return true;
} }

View File

@ -62,6 +62,7 @@ public class SqlReturnResultSet extends ResultSetSupportingSqlParameter {
* results preocessing of the CallableStatement.getMoreResults/getUpdateCount. * results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
* <p>This implementation always returns <code>true</code>. * <p>This implementation always returns <code>true</code>.
*/ */
@Override
public boolean isResultsParameter() { public boolean isResultsParameter() {
return true; return true;
} }

View File

@ -26,6 +26,7 @@ public class SqlReturnUpdateCount extends SqlParameter {
* before execution even if they are <code>null</code>. * before execution even if they are <code>null</code>.
* <p>This implementation always returns <code>false</code>. * <p>This implementation always returns <code>false</code>.
*/ */
@Override
public boolean isInputValueProvided() { public boolean isInputValueProvided() {
return false; return false;
} }
@ -35,6 +36,7 @@ public class SqlReturnUpdateCount extends SqlParameter {
* results preocessing of the CallableStatement.getMoreResults/getUpdateCount. * results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
* <p>This implementation always returns <code>true</code>. * <p>This implementation always returns <code>true</code>.
*/ */
@Override
public boolean isResultsParameter() { public boolean isResultsParameter() {
return true; return true;
} }

View File

@ -33,11 +33,13 @@ public class HsqlTableMetaDataProvider extends GenericTableMetaDataProvider {
} }
@Override
public boolean isGetGeneratedKeysSimulated() { public boolean isGetGeneratedKeysSimulated() {
return true; return true;
} }
@Override
public String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName) { public String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName) {
return "select max(identity()) from " + tableName; return "select max(identity()) from " + tableName;
} }

View File

@ -17,6 +17,7 @@ public class PostgresTableMetaDataProvider extends GenericTableMetaDataProvider
} }
@Override
public boolean isGetGeneratedKeysSimulated() { public boolean isGetGeneratedKeysSimulated() {
if (getDatabaseVersion().compareTo("8.2.0") >= 0) { if (getDatabaseVersion().compareTo("8.2.0") >= 0) {
return true; return true;
@ -28,6 +29,7 @@ public class PostgresTableMetaDataProvider extends GenericTableMetaDataProvider
} }
@Override
public String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName) { public String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName) {
return "RETURNING " + keyColumnName; return "RETURNING " + keyColumnName;
} }

View File

@ -91,6 +91,7 @@ public class BeanPropertySqlParameterSource extends AbstractSqlParameterSource {
* Derives a default SQL type from the corresponding property type. * Derives a default SQL type from the corresponding property type.
* @see org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType * @see org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType
*/ */
@Override
public int getSqlType(String paramName) { public int getSqlType(String paramName) {
int sqlType = super.getSqlType(paramName); int sqlType = super.getSqlType(paramName);
if (sqlType != TYPE_UNKNOWN) { if (sqlType != TYPE_UNKNOWN) {

View File

@ -34,6 +34,7 @@ public class NamedParameterJdbcDaoSupport extends JdbcDaoSupport {
/** /**
* Create a NamedParameterJdbcTemplate based on the configured JdbcTemplate. * Create a NamedParameterJdbcTemplate based on the configured JdbcTemplate.
*/ */
@Override
protected void initTemplateConfig() { protected void initTemplateConfig() {
this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(getJdbcTemplate()); this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(getJdbcTemplate());
} }

View File

@ -137,6 +137,7 @@ public class ParsedSql {
/** /**
* Exposes the original SQL String. * Exposes the original SQL String.
*/ */
@Override
public String toString() { public String toString() {
return this.originalSql; return this.originalSql;
} }

View File

@ -61,6 +61,7 @@ public class ParameterizedBeanPropertyRowMapper<T> extends BeanPropertyRowMapper
public ParameterizedBeanPropertyRowMapper() { public ParameterizedBeanPropertyRowMapper() {
} }
@Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public T mapRow(ResultSet rs, int rowNumber) throws SQLException { public T mapRow(ResultSet rs, int rowNumber) throws SQLException {
return (T) super.mapRow(rs, rowNumber); return (T) super.mapRow(rs, rowNumber);

View File

@ -48,6 +48,7 @@ public class ParameterizedSingleColumnRowMapper<T> extends SingleColumnRowMapper
public ParameterizedSingleColumnRowMapper() { public ParameterizedSingleColumnRowMapper() {
} }
@Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public T mapRow(ResultSet rs, int rowNumber) throws SQLException { public T mapRow(ResultSet rs, int rowNumber) throws SQLException {
return (T) super.mapRow(rs, rowNumber); return (T) super.mapRow(rs, rowNumber);

View File

@ -36,6 +36,7 @@ public class SimpleJdbcDaoSupport extends JdbcDaoSupport {
/** /**
* Create a SimpleJdbcTemplate based on the configured JdbcTemplate. * Create a SimpleJdbcTemplate based on the configured JdbcTemplate.
*/ */
@Override
protected void initTemplateConfig() { protected void initTemplateConfig() {
this.simpleJdbcTemplate = new SimpleJdbcTemplate(getJdbcTemplate()); this.simpleJdbcTemplate = new SimpleJdbcTemplate(getJdbcTemplate());
} }

View File

@ -106,6 +106,7 @@ public abstract class JdbcDaoSupport extends DaoSupport {
protected void initTemplateConfig() { protected void initTemplateConfig() {
} }
@Override
protected void checkDaoConfig() { protected void checkDaoConfig() {
if (this.jdbcTemplate == null) { if (this.jdbcTemplate == null) {
throw new IllegalArgumentException("'dataSource' or 'jdbcTemplate' is required"); throw new IllegalArgumentException("'dataSource' or 'jdbcTemplate' is required");

View File

@ -186,6 +186,7 @@ public class ConnectionHolder extends ResourceHolderSupport {
* JDO 2.0 DataStoreConnections, for example. * JDO 2.0 DataStoreConnections, for example.
* @see org.springframework.orm.jdo.DefaultJdoDialect#getJdbcConnection * @see org.springframework.orm.jdo.DefaultJdoDialect#getJdbcConnection
*/ */
@Override
public void released() { public void released() {
super.released(); super.released();
if (this.currentConnection != null) { if (this.currentConnection != null) {
@ -195,6 +196,7 @@ public class ConnectionHolder extends ResourceHolderSupport {
} }
@Override
public void clear() { public void clear() {
super.clear(); super.clear();
this.transactionActive = false; this.transactionActive = false;

View File

@ -173,6 +173,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
return getDataSource(); return getDataSource();
} }
@Override
protected Object doGetTransaction() { protected Object doGetTransaction() {
DataSourceTransactionObject txObject = new DataSourceTransactionObject(); DataSourceTransactionObject txObject = new DataSourceTransactionObject();
txObject.setSavepointAllowed(isNestedTransactionAllowed()); txObject.setSavepointAllowed(isNestedTransactionAllowed());
@ -182,6 +183,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
return txObject; return txObject;
} }
@Override
protected boolean isExistingTransaction(Object transaction) { protected boolean isExistingTransaction(Object transaction) {
DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction; DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction;
return (txObject.getConnectionHolder() != null && txObject.getConnectionHolder().isTransactionActive()); return (txObject.getConnectionHolder() != null && txObject.getConnectionHolder().isTransactionActive());
@ -190,6 +192,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
/** /**
* This implementation sets the isolation level but ignores the timeout. * This implementation sets the isolation level but ignores the timeout.
*/ */
@Override
protected void doBegin(Object transaction, TransactionDefinition definition) { protected void doBegin(Object transaction, TransactionDefinition definition) {
DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction; DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction;
Connection con = null; Connection con = null;
@ -239,6 +242,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
} }
} }
@Override
protected Object doSuspend(Object transaction) { protected Object doSuspend(Object transaction) {
DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction; DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction;
txObject.setConnectionHolder(null); txObject.setConnectionHolder(null);
@ -247,11 +251,13 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
return conHolder; return conHolder;
} }
@Override
protected void doResume(Object transaction, Object suspendedResources) { protected void doResume(Object transaction, Object suspendedResources) {
ConnectionHolder conHolder = (ConnectionHolder) suspendedResources; ConnectionHolder conHolder = (ConnectionHolder) suspendedResources;
TransactionSynchronizationManager.bindResource(this.dataSource, conHolder); TransactionSynchronizationManager.bindResource(this.dataSource, conHolder);
} }
@Override
protected void doCommit(DefaultTransactionStatus status) { protected void doCommit(DefaultTransactionStatus status) {
DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction(); DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction();
Connection con = txObject.getConnectionHolder().getConnection(); Connection con = txObject.getConnectionHolder().getConnection();
@ -266,6 +272,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
} }
} }
@Override
protected void doRollback(DefaultTransactionStatus status) { protected void doRollback(DefaultTransactionStatus status) {
DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction(); DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction();
Connection con = txObject.getConnectionHolder().getConnection(); Connection con = txObject.getConnectionHolder().getConnection();
@ -280,6 +287,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
} }
} }
@Override
protected void doSetRollbackOnly(DefaultTransactionStatus status) { protected void doSetRollbackOnly(DefaultTransactionStatus status) {
DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction(); DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction();
if (status.isDebug()) { if (status.isDebug()) {
@ -289,6 +297,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
txObject.setRollbackOnly(); txObject.setRollbackOnly();
} }
@Override
protected void doCleanupAfterCompletion(Object transaction) { protected void doCleanupAfterCompletion(Object transaction) {
DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction; DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction;

View File

@ -391,10 +391,12 @@ public abstract class DataSourceUtils {
this.order = getConnectionSynchronizationOrder(dataSource); this.order = getConnectionSynchronizationOrder(dataSource);
} }
@Override
public int getOrder() { public int getOrder() {
return this.order; return this.order;
} }
@Override
public void suspend() { public void suspend() {
if (this.holderActive) { if (this.holderActive) {
TransactionSynchronizationManager.unbindResource(this.dataSource); TransactionSynchronizationManager.unbindResource(this.dataSource);
@ -409,12 +411,14 @@ public abstract class DataSourceUtils {
} }
} }
@Override
public void resume() { public void resume() {
if (this.holderActive) { if (this.holderActive) {
TransactionSynchronizationManager.bindResource(this.dataSource, this.connectionHolder); TransactionSynchronizationManager.bindResource(this.dataSource, this.connectionHolder);
} }
} }
@Override
public void beforeCompletion() { public void beforeCompletion() {
// Release Connection early if the holder is not open anymore // Release Connection early if the holder is not open anymore
// (that is, not used by another resource like a Hibernate Session // (that is, not used by another resource like a Hibernate Session
@ -430,6 +434,7 @@ public abstract class DataSourceUtils {
} }
} }
@Override
public void afterCompletion(int status) { public void afterCompletion(int status) {
// If we haven't closed the Connection in beforeCompletion, // If we haven't closed the Connection in beforeCompletion,
// close it now. The holder might have been used for other // close it now. The holder might have been used for other

View File

@ -119,6 +119,7 @@ public class DriverManagerDataSource extends AbstractDriverBasedDataSource {
* If you need to register a new driver, consider using * If you need to register a new driver, consider using
* {@link SimpleDriverDataSource} instead. * {@link SimpleDriverDataSource} instead.
*/ */
@Deprecated
public DriverManagerDataSource(String driverClassName, String url, String username, String password) { public DriverManagerDataSource(String driverClassName, String url, String username, String password) {
setDriverClassName(driverClassName); setDriverClassName(driverClassName);
setUrl(url); setUrl(url);
@ -157,6 +158,7 @@ public class DriverManagerDataSource extends AbstractDriverBasedDataSource {
} }
@Override
protected Connection getConnectionFromDriver(Properties props) throws SQLException { protected Connection getConnectionFromDriver(Properties props) throws SQLException {
String url = getUrl(); String url = getUrl();
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {

View File

@ -123,6 +123,7 @@ public class IsolationLevelDataSourceAdapter extends UserCredentialsDataSourceAd
* @see #getCurrentIsolationLevel() * @see #getCurrentIsolationLevel()
* @see #getCurrentReadOnlyFlag() * @see #getCurrentReadOnlyFlag()
*/ */
@Override
protected Connection doGetConnection(String username, String password) throws SQLException { protected Connection doGetConnection(String username, String password) throws SQLException {
Connection con = super.doGetConnection(username, password); Connection con = super.doGetConnection(username, password);
Boolean readOnlyToUse = getCurrentReadOnlyFlag(); Boolean readOnlyToUse = getCurrentReadOnlyFlag();

View File

@ -153,6 +153,7 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
} }
@Override
public void afterPropertiesSet() { public void afterPropertiesSet() {
super.afterPropertiesSet(); super.afterPropertiesSet();
@ -216,6 +217,7 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
* @return a lazy Connection handle * @return a lazy Connection handle
* @see ConnectionProxy#getTargetConnection() * @see ConnectionProxy#getTargetConnection()
*/ */
@Override
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
return (Connection) Proxy.newProxyInstance( return (Connection) Proxy.newProxyInstance(
ConnectionProxy.class.getClassLoader(), ConnectionProxy.class.getClassLoader(),
@ -233,6 +235,7 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
* @return a lazy Connection handle * @return a lazy Connection handle
* @see ConnectionProxy#getTargetConnection() * @see ConnectionProxy#getTargetConnection()
*/ */
@Override
public Connection getConnection(String username, String password) throws SQLException { public Connection getConnection(String username, String password) throws SQLException {
return (Connection) Proxy.newProxyInstance( return (Connection) Proxy.newProxyInstance(
ConnectionProxy.class.getClassLoader(), ConnectionProxy.class.getClassLoader(),

View File

@ -56,6 +56,7 @@ public class SimpleConnectionHandle implements ConnectionHandle {
} }
@Override
public String toString() { public String toString() {
return "SimpleConnectionHandle: " + this.connection; return "SimpleConnectionHandle: " + this.connection;
} }

View File

@ -129,6 +129,7 @@ public class SimpleDriverDataSource extends AbstractDriverBasedDataSource {
} }
@Override
protected Connection getConnectionFromDriver(Properties props) throws SQLException { protected Connection getConnectionFromDriver(Properties props) throws SQLException {
Driver driver = getDriver(); Driver driver = getDriver();
String url = getUrl(); String url = getUrl();

View File

@ -94,6 +94,7 @@ public class SingleConnectionDataSource extends DriverManagerDataSource
* directly, set up the Driver class manually before invoking this DataSource. * directly, set up the Driver class manually before invoking this DataSource.
* @see java.sql.DriverManager#getConnection(String, String, String) * @see java.sql.DriverManager#getConnection(String, String, String)
*/ */
@Deprecated
public SingleConnectionDataSource( public SingleConnectionDataSource(
String driverClassName, String url, String username, String password, boolean suppressClose) { String driverClassName, String url, String username, String password, boolean suppressClose) {
@ -177,6 +178,7 @@ public class SingleConnectionDataSource extends DriverManagerDataSource
} }
@Override
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
synchronized (this.connectionMonitor) { synchronized (this.connectionMonitor) {
if (this.connection == null) { if (this.connection == null) {
@ -197,6 +199,7 @@ public class SingleConnectionDataSource extends DriverManagerDataSource
* with a single Connection. Returns the single Connection if given * with a single Connection. Returns the single Connection if given
* the same username and password; throws a SQLException else. * the same username and password; throws a SQLException else.
*/ */
@Override
public Connection getConnection(String username, String password) throws SQLException { public Connection getConnection(String username, String password) throws SQLException {
if (ObjectUtils.nullSafeEquals(username, getUsername()) && if (ObjectUtils.nullSafeEquals(username, getUsername()) &&
ObjectUtils.nullSafeEquals(password, getPassword())) { ObjectUtils.nullSafeEquals(password, getPassword())) {

View File

@ -121,6 +121,7 @@ public class TransactionAwareDataSourceProxy extends DelegatingDataSource {
* @see DataSourceUtils#doGetConnection * @see DataSourceUtils#doGetConnection
* @see ConnectionProxy#getTargetConnection * @see ConnectionProxy#getTargetConnection
*/ */
@Override
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
DataSource ds = getTargetDataSource(); DataSource ds = getTargetDataSource();
Assert.state(ds != null, "'targetDataSource' is required"); Assert.state(ds != null, "'targetDataSource' is required");

View File

@ -124,6 +124,7 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource {
* <p>Delegates to {@link #doGetConnection(String, String)} with the * <p>Delegates to {@link #doGetConnection(String, String)} with the
* determined credentials as parameters. * determined credentials as parameters.
*/ */
@Override
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
JdbcUserCredentials threadCredentials = (JdbcUserCredentials) this.threadBoundCredentials.get(); JdbcUserCredentials threadCredentials = (JdbcUserCredentials) this.threadBoundCredentials.get();
if (threadCredentials != null) { if (threadCredentials != null) {
@ -138,6 +139,7 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource {
* Simply delegates to {@link #doGetConnection(String, String)}, * Simply delegates to {@link #doGetConnection(String, String)},
* keeping the given user credentials as-is. * keeping the given user credentials as-is.
*/ */
@Override
public Connection getConnection(String username, String password) throws SQLException { public Connection getConnection(String username, String password) throws SQLException {
return doGetConnection(username, password); return doGetConnection(username, password);
} }
@ -178,6 +180,7 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource {
this.password = password; this.password = password;
} }
@Override
public String toString() { public String toString() {
return "JdbcUserCredentials[username='" + this.username + "',password='" + this.password + "']"; return "JdbcUserCredentials[username='" + this.username + "',password='" + this.password + "']";
} }

View File

@ -113,6 +113,7 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter
* Checks that the specified 'targetDataSource' actually is * Checks that the specified 'targetDataSource' actually is
* a WebSphere WSDataSource. * a WebSphere WSDataSource.
*/ */
@Override
public void afterPropertiesSet() { public void afterPropertiesSet() {
super.afterPropertiesSet(); super.afterPropertiesSet();
@ -129,6 +130,7 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter
* @see #createConnectionSpec * @see #createConnectionSpec
* @see com.ibm.websphere.rsadapter.WSDataSource#getConnection(com.ibm.websphere.rsadapter.JDBCConnectionSpec) * @see com.ibm.websphere.rsadapter.WSDataSource#getConnection(com.ibm.websphere.rsadapter.JDBCConnectionSpec)
*/ */
@Override
protected Connection doGetConnection(String username, String password) throws SQLException { protected Connection doGetConnection(String username, String password) throws SQLException {
// Create JDBCConnectionSpec using current isolation level value and read-only flag. // Create JDBCConnectionSpec using current isolation level value and read-only flag.
Object connSpec = createConnectionSpec( Object connSpec = createConnectionSpec(

View File

@ -100,6 +100,7 @@ public class IsolationLevelDataSourceRouter extends AbstractRoutingDataSource {
* as well as isolation level names as defined on the * as well as isolation level names as defined on the
* {@link org.springframework.transaction.TransactionDefinition TransactionDefinition interface}. * {@link org.springframework.transaction.TransactionDefinition TransactionDefinition interface}.
*/ */
@Override
protected Object resolveSpecifiedLookupKey(Object lookupKey) { protected Object resolveSpecifiedLookupKey(Object lookupKey) {
if (lookupKey instanceof Integer) { if (lookupKey instanceof Integer) {
return (Integer) lookupKey; return (Integer) lookupKey;
@ -117,6 +118,7 @@ public class IsolationLevelDataSourceRouter extends AbstractRoutingDataSource {
} }
} }
@Override
protected Object determineCurrentLookupKey() { protected Object determineCurrentLookupKey() {
return TransactionSynchronizationManager.getCurrentTransactionIsolationLevel(); return TransactionSynchronizationManager.getCurrentTransactionIsolationLevel();
} }

View File

@ -138,6 +138,7 @@ public class BatchSqlUpdate extends SqlUpdate {
/** /**
* BatchSqlUpdate does not support BLOB or CLOB parameters. * BatchSqlUpdate does not support BLOB or CLOB parameters.
*/ */
@Override
protected boolean supportsLobParameters() { protected boolean supportsLobParameters() {
return false; return false;
} }
@ -157,6 +158,7 @@ public class BatchSqlUpdate extends SqlUpdate {
* executed by this method) * executed by this method)
* @see #flush * @see #flush
*/ */
@Override
public int update(Object[] params) throws DataAccessException { public int update(Object[] params) throws DataAccessException {
validateParameters(params); validateParameters(params);
this.parameterQueue.add(params.clone()); this.parameterQueue.add(params.clone());

View File

@ -58,6 +58,7 @@ public abstract class MappingSqlQuery extends MappingSqlQueryWithParameters {
* template method, ignoring parameters. * template method, ignoring parameters.
* @see #mapRow(ResultSet, int) * @see #mapRow(ResultSet, int)
*/ */
@Override
protected final Object mapRow(ResultSet rs, int rowNum, Object[] parameters, Map context) protected final Object mapRow(ResultSet rs, int rowNum, Object[] parameters, Map context)
throws SQLException { throws SQLException {

View File

@ -70,6 +70,7 @@ public abstract class MappingSqlQueryWithParameters extends SqlQuery {
* Implementation of protected abstract method. This invokes the subclass's * Implementation of protected abstract method. This invokes the subclass's
* implementation of the mapRow() method. * implementation of the mapRow() method.
*/ */
@Override
protected RowMapper newRowMapper(Object[] parameters, Map context) { protected RowMapper newRowMapper(Object[] parameters, Map context) {
return new RowMapperImpl(parameters, context); return new RowMapperImpl(parameters, context);
} }

View File

@ -124,6 +124,7 @@ public abstract class SqlCall extends RdbmsOperation {
* based on our declared parameters. * based on our declared parameters.
* @see RdbmsOperation#compileInternal() * @see RdbmsOperation#compileInternal()
*/ */
@Override
protected final void compileInternal() { protected final void compileInternal() {
if (isSqlReadyForUse()) { if (isSqlReadyForUse()) {
this.callString = getSql(); this.callString = getSql();

View File

@ -128,6 +128,7 @@ public class SqlFunction extends MappingSqlQuery {
* single row returned by the function. If there are a different number * single row returned by the function. If there are a different number
* of rows returned, this is treated as an error. * of rows returned, this is treated as an error.
*/ */
@Override
protected Object mapRow(ResultSet rs, int rowNum) throws SQLException { protected Object mapRow(ResultSet rs, int rowNum) throws SQLException {
return this.rowMapper.mapRow(rs, rowNum); return this.rowMapper.mapRow(rs, rowNum);
} }

View File

@ -51,6 +51,7 @@ public abstract class SqlOperation extends RdbmsOperation {
* Overridden method to configure the PreparedStatementCreatorFactory * Overridden method to configure the PreparedStatementCreatorFactory
* based on our declared parameters. * based on our declared parameters.
*/ */
@Override
protected final void compileInternal() { protected final void compileInternal() {
this.preparedStatementFactory = new PreparedStatementCreatorFactory(getSql(), getDeclaredParameters()); this.preparedStatementFactory = new PreparedStatementCreatorFactory(getSql(), getDeclaredParameters());
this.preparedStatementFactory.setResultSetType(getResultSetType()); this.preparedStatementFactory.setResultSetType(getResultSetType());

View File

@ -75,6 +75,7 @@ public abstract class StoredProcedure extends SqlCall {
* StoredProcedure parameter Maps are by default allowed to contain * StoredProcedure parameter Maps are by default allowed to contain
* additional entries that are not actually used as parameters. * additional entries that are not actually used as parameters.
*/ */
@Override
protected boolean allowsUnusedParameters() { protected boolean allowsUnusedParameters() {
return true; return true;
} }
@ -90,6 +91,7 @@ public abstract class StoredProcedure extends SqlCall {
* Names are purely used to help mapping. * Names are purely used to help mapping.
* @param param parameter object * @param param parameter object
*/ */
@Override
public void declareParameter(SqlParameter param) throws InvalidDataAccessApiUsageException { public void declareParameter(SqlParameter param) throws InvalidDataAccessApiUsageException {
if (param.getName() == null) { if (param.getName() == null) {
throw new InvalidDataAccessApiUsageException("Parameters to stored procedures must have names as well as types"); throw new InvalidDataAccessApiUsageException("Parameters to stored procedures must have names as well as types");

View File

@ -58,6 +58,7 @@ public abstract class UpdatableSqlQuery extends SqlQuery {
* Implementation of the superclass template method. This invokes the subclass's * Implementation of the superclass template method. This invokes the subclass's
* implementation of the <code>updateRow()</code> method. * implementation of the <code>updateRow()</code> method.
*/ */
@Override
protected RowMapper newRowMapper(Object[] parameters, Map context) { protected RowMapper newRowMapper(Object[] parameters, Map context) {
return new RowMapperImpl(context); return new RowMapperImpl(context);
} }

View File

@ -170,6 +170,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep
} }
@Override
protected DataAccessException doTranslate(String task, String sql, SQLException ex) { protected DataAccessException doTranslate(String task, String sql, SQLException ex) {
SQLException sqlEx = ex; SQLException sqlEx = ex;
if (sqlEx instanceof BatchUpdateException && sqlEx.getNextException() != null) { if (sqlEx instanceof BatchUpdateException && sqlEx.getNextException() != null) {

View File

@ -61,6 +61,7 @@ public class SQLExceptionSubclassTranslator extends AbstractFallbackSQLException
setFallbackTranslator(new SQLStateSQLExceptionTranslator()); setFallbackTranslator(new SQLStateSQLExceptionTranslator());
} }
@Override
protected DataAccessException doTranslate(String task, String sql, SQLException ex) { protected DataAccessException doTranslate(String task, String sql, SQLException ex) {
if (ex instanceof SQLTransientException) { if (ex instanceof SQLTransientException) {
if (ex instanceof SQLTransactionRollbackException) { if (ex instanceof SQLTransactionRollbackException) {

View File

@ -86,6 +86,7 @@ public class SQLStateSQLExceptionTranslator extends AbstractFallbackSQLException
} }
@Override
protected DataAccessException doTranslate(String task, String sql, SQLException ex) { protected DataAccessException doTranslate(String task, String sql, SQLException ex) {
String sqlState = getSqlState(ex); String sqlState = getSqlState(ex);
if (sqlState != null && sqlState.length() >= 2) { if (sqlState != null && sqlState.length() >= 2) {

View File

@ -87,6 +87,7 @@ public abstract class AbstractColumnMaxValueIncrementer extends AbstractDataFiel
return this.cacheSize; return this.cacheSize;
} }
@Override
public void afterPropertiesSet() { public void afterPropertiesSet() {
super.afterPropertiesSet(); super.afterPropertiesSet();
if (this.columnName == null) { if (this.columnName == null) {

View File

@ -59,6 +59,7 @@ public abstract class AbstractSequenceMaxValueIncrementer extends AbstractDataFi
/** /**
* Executes the SQL as specified by {@link #getSequenceQuery()}. * Executes the SQL as specified by {@link #getSequenceQuery()}.
*/ */
@Override
protected long getNextKey() throws DataAccessException { protected long getNextKey() throws DataAccessException {
Connection con = DataSourceUtils.getConnection(getDataSource()); Connection con = DataSourceUtils.getConnection(getDataSource());
Statement stmt = null; Statement stmt = null;

View File

@ -46,6 +46,7 @@ public class DB2MainframeSequenceMaxValueIncrementer extends AbstractSequenceMax
} }
@Override
protected String getSequenceQuery() { protected String getSequenceQuery() {
return "select next value for " + getIncrementerName() + " from sysibm.sysdummy1"; return "select next value for " + getIncrementerName() + " from sysibm.sysdummy1";
} }

View File

@ -46,6 +46,7 @@ public class DB2SequenceMaxValueIncrementer extends AbstractSequenceMaxValueIncr
} }
@Override
protected String getSequenceQuery() { protected String getSequenceQuery() {
return "values nextval for " + getIncrementerName(); return "values nextval for " + getIncrementerName();
} }

View File

@ -126,6 +126,7 @@ public class DerbyMaxValueIncrementer extends AbstractColumnMaxValueIncrementer
} }
@Override
protected synchronized long getNextKey() throws DataAccessException { protected synchronized long getNextKey() throws DataAccessException {
if (this.nextValueIndex < 0 || this.nextValueIndex >= getCacheSize()) { if (this.nextValueIndex < 0 || this.nextValueIndex >= getCacheSize()) {
/* /*

View File

@ -44,6 +44,7 @@ public class H2SequenceMaxValueIncrementer extends AbstractSequenceMaxValueIncre
} }
@Override
protected String getSequenceQuery() { protected String getSequenceQuery() {
return "select " + getIncrementerName() + ".nextval from dual"; return "select " + getIncrementerName() + ".nextval from dual";
} }

View File

@ -84,6 +84,7 @@ public class HsqlMaxValueIncrementer extends AbstractColumnMaxValueIncrementer {
} }
@Override
protected synchronized long getNextKey() throws DataAccessException { protected synchronized long getNextKey() throws DataAccessException {
if (this.nextValueIndex < 0 || this.nextValueIndex >= getCacheSize()) { if (this.nextValueIndex < 0 || this.nextValueIndex >= getCacheSize()) {
/* /*

View File

@ -49,6 +49,7 @@ public class HsqlSequenceMaxValueIncrementer extends AbstractSequenceMaxValueInc
} }
@Override
protected String getSequenceQuery() { protected String getSequenceQuery() {
return "call next value for " + getIncrementerName(); return "call next value for " + getIncrementerName();
} }

View File

@ -85,6 +85,7 @@ public class MySQLMaxValueIncrementer extends AbstractColumnMaxValueIncrementer
} }
@Override
protected synchronized long getNextKey() throws DataAccessException { protected synchronized long getNextKey() throws DataAccessException {
if (this.maxId == this.nextId) { if (this.maxId == this.nextId) {
/* /*

View File

@ -45,6 +45,7 @@ public class OracleSequenceMaxValueIncrementer extends AbstractSequenceMaxValueI
} }
@Override
protected String getSequenceQuery() { protected String getSequenceQuery() {
return "select " + getIncrementerName() + ".nextval from dual"; return "select " + getIncrementerName() + ".nextval from dual";
} }

View File

@ -44,6 +44,7 @@ public class PostgreSQLSequenceMaxValueIncrementer extends AbstractSequenceMaxVa
} }
@Override
protected String getSequenceQuery() { protected String getSequenceQuery() {
return "select nextval('" + getIncrementerName() + "')"; return "select nextval('" + getIncrementerName() + "')";
} }

View File

@ -73,6 +73,7 @@ public class SqlServerMaxValueIncrementer extends AbstractColumnMaxValueIncremen
} }
@Override
protected synchronized long getNextKey() throws DataAccessException { protected synchronized long getNextKey() throws DataAccessException {
if (this.nextValueIndex < 0 || this.nextValueIndex >= getCacheSize()) { if (this.nextValueIndex < 0 || this.nextValueIndex >= getCacheSize()) {
/* /*

View File

@ -73,6 +73,7 @@ public class SybaseMaxValueIncrementer extends AbstractColumnMaxValueIncrementer
} }
@Override
protected synchronized long getNextKey() throws DataAccessException { protected synchronized long getNextKey() throws DataAccessException {
if (this.nextValueIndex < 0 || this.nextValueIndex >= getCacheSize()) { if (this.nextValueIndex < 0 || this.nextValueIndex >= getCacheSize()) {
/* /*

View File

@ -55,11 +55,13 @@ public class SpringLobCreatorSynchronization extends TransactionSynchronizationA
this.lobCreator = lobCreator; this.lobCreator = lobCreator;
} }
@Override
public int getOrder() { public int getOrder() {
return LOB_CREATOR_SYNCHRONIZATION_ORDER; return LOB_CREATOR_SYNCHRONIZATION_ORDER;
} }
@Override
public void beforeCompletion() { public void beforeCompletion() {
// Close the LobCreator early if possible, to avoid issues with strict JTA // Close the LobCreator early if possible, to avoid issues with strict JTA
// implementations that issue warnings when doing JDBC operations after // implementations that issue warnings when doing JDBC operations after
@ -68,6 +70,7 @@ public class SpringLobCreatorSynchronization extends TransactionSynchronizationA
this.lobCreator.close(); this.lobCreator.close();
} }
@Override
public void afterCompletion(int status) { public void afterCompletion(int status) {
if (!this.beforeCompletionCalled) { if (!this.beforeCompletionCalled) {
// beforeCompletion not called before (probably because of flushing on commit // beforeCompletion not called before (probably because of flushing on commit

View File

@ -71,14 +71,17 @@ public class C3P0NativeJdbcExtractor extends NativeJdbcExtractorAdapter {
} }
@Override
public boolean isNativeConnectionNecessaryForNativeStatements() { public boolean isNativeConnectionNecessaryForNativeStatements() {
return true; return true;
} }
@Override
public boolean isNativeConnectionNecessaryForNativePreparedStatements() { public boolean isNativeConnectionNecessaryForNativePreparedStatements() {
return true; return true;
} }
@Override
public boolean isNativeConnectionNecessaryForNativeCallableStatements() { public boolean isNativeConnectionNecessaryForNativeCallableStatements() {
return true; return true;
} }
@ -89,6 +92,7 @@ public class C3P0NativeJdbcExtractor extends NativeJdbcExtractorAdapter {
* raw Connection (which is otherwise not directly supported by C3P0). * raw Connection (which is otherwise not directly supported by C3P0).
* @see #getRawConnection * @see #getRawConnection
*/ */
@Override
protected Connection doGetNativeConnection(Connection con) throws SQLException { protected Connection doGetNativeConnection(Connection con) throws SQLException {
if (con instanceof C3P0ProxyConnection) { if (con instanceof C3P0ProxyConnection) {
C3P0ProxyConnection cpCon = (C3P0ProxyConnection) con; C3P0ProxyConnection cpCon = (C3P0ProxyConnection) con;

View File

@ -84,22 +84,27 @@ public class CommonsDbcpNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
} }
@Override
protected Connection doGetNativeConnection(Connection con) throws SQLException { protected Connection doGetNativeConnection(Connection con) throws SQLException {
return (Connection) getInnermostDelegate(con); return (Connection) getInnermostDelegate(con);
} }
@Override
public Statement getNativeStatement(Statement stmt) throws SQLException { public Statement getNativeStatement(Statement stmt) throws SQLException {
return (Statement) getInnermostDelegate(stmt); return (Statement) getInnermostDelegate(stmt);
} }
@Override
public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException { public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException {
return (PreparedStatement) getNativeStatement(ps); return (PreparedStatement) getNativeStatement(ps);
} }
@Override
public CallableStatement getNativeCallableStatement(CallableStatement cs) throws SQLException { public CallableStatement getNativeCallableStatement(CallableStatement cs) throws SQLException {
return (CallableStatement) getNativeStatement(cs); return (CallableStatement) getNativeStatement(cs);
} }
@Override
public ResultSet getNativeResultSet(ResultSet rs) throws SQLException { public ResultSet getNativeResultSet(ResultSet rs) throws SQLException {
return (ResultSet) getInnermostDelegate(rs); return (ResultSet) getInnermostDelegate(rs);
} }

View File

@ -93,6 +93,7 @@ public class JBossNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Retrieve the Connection via JBoss' <code>getUnderlyingConnection</code> method. * Retrieve the Connection via JBoss' <code>getUnderlyingConnection</code> method.
*/ */
@Override
protected Connection doGetNativeConnection(Connection con) throws SQLException { protected Connection doGetNativeConnection(Connection con) throws SQLException {
if (this.wrappedConnectionClass.isAssignableFrom(con.getClass())) { if (this.wrappedConnectionClass.isAssignableFrom(con.getClass())) {
return (Connection) ReflectionUtils.invokeJdbcMethod(this.getUnderlyingConnectionMethod, con); return (Connection) ReflectionUtils.invokeJdbcMethod(this.getUnderlyingConnectionMethod, con);
@ -103,6 +104,7 @@ public class JBossNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Retrieve the Connection via JBoss' <code>getUnderlyingStatement</code> method. * Retrieve the Connection via JBoss' <code>getUnderlyingStatement</code> method.
*/ */
@Override
public Statement getNativeStatement(Statement stmt) throws SQLException { public Statement getNativeStatement(Statement stmt) throws SQLException {
if (this.wrappedStatementClass.isAssignableFrom(stmt.getClass())) { if (this.wrappedStatementClass.isAssignableFrom(stmt.getClass())) {
return (Statement) ReflectionUtils.invokeJdbcMethod(this.getUnderlyingStatementMethod, stmt); return (Statement) ReflectionUtils.invokeJdbcMethod(this.getUnderlyingStatementMethod, stmt);
@ -113,6 +115,7 @@ public class JBossNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Retrieve the Connection via JBoss' <code>getUnderlyingStatement</code> method. * Retrieve the Connection via JBoss' <code>getUnderlyingStatement</code> method.
*/ */
@Override
public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException { public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException {
return (PreparedStatement) getNativeStatement(ps); return (PreparedStatement) getNativeStatement(ps);
} }
@ -120,6 +123,7 @@ public class JBossNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Retrieve the Connection via JBoss' <code>getUnderlyingStatement</code> method. * Retrieve the Connection via JBoss' <code>getUnderlyingStatement</code> method.
*/ */
@Override
public CallableStatement getNativeCallableStatement(CallableStatement cs) throws SQLException { public CallableStatement getNativeCallableStatement(CallableStatement cs) throws SQLException {
return (CallableStatement) getNativeStatement(cs); return (CallableStatement) getNativeStatement(cs);
} }
@ -127,6 +131,7 @@ public class JBossNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Retrieve the Connection via JBoss' <code>getUnderlyingResultSet</code> method. * Retrieve the Connection via JBoss' <code>getUnderlyingResultSet</code> method.
*/ */
@Override
public ResultSet getNativeResultSet(ResultSet rs) throws SQLException { public ResultSet getNativeResultSet(ResultSet rs) throws SQLException {
if (this.wrappedResultSetClass.isAssignableFrom(rs.getClass())) { if (this.wrappedResultSetClass.isAssignableFrom(rs.getClass())) {
return (ResultSet) ReflectionUtils.invokeJdbcMethod(this.getUnderlyingResultSetMethod, rs); return (ResultSet) ReflectionUtils.invokeJdbcMethod(this.getUnderlyingResultSetMethod, rs);

View File

@ -40,22 +40,27 @@ import java.sql.Statement;
*/ */
public class Jdbc4NativeJdbcExtractor extends NativeJdbcExtractorAdapter { public class Jdbc4NativeJdbcExtractor extends NativeJdbcExtractorAdapter {
@Override
protected Connection doGetNativeConnection(Connection con) throws SQLException { protected Connection doGetNativeConnection(Connection con) throws SQLException {
return (Connection) con.unwrap(Connection.class); return (Connection) con.unwrap(Connection.class);
} }
@Override
public Statement getNativeStatement(Statement stmt) throws SQLException { public Statement getNativeStatement(Statement stmt) throws SQLException {
return (Statement) stmt.unwrap(Statement.class); return (Statement) stmt.unwrap(Statement.class);
} }
@Override
public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException { public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException {
return (PreparedStatement) ps.unwrap(PreparedStatement.class); return (PreparedStatement) ps.unwrap(PreparedStatement.class);
} }
@Override
public CallableStatement getNativeCallableStatement(CallableStatement cs) throws SQLException { public CallableStatement getNativeCallableStatement(CallableStatement cs) throws SQLException {
return (CallableStatement) cs.unwrap(CallableStatement.class); return (CallableStatement) cs.unwrap(CallableStatement.class);
} }
@Override
public ResultSet getNativeResultSet(ResultSet rs) throws SQLException { public ResultSet getNativeResultSet(ResultSet rs) throws SQLException {
return (ResultSet) rs.unwrap(ResultSet.class); return (ResultSet) rs.unwrap(ResultSet.class);
} }

View File

@ -94,6 +94,7 @@ public class SimpleNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
this.nativeConnectionNecessaryForNativeStatements = nativeConnectionNecessaryForNativeStatements; this.nativeConnectionNecessaryForNativeStatements = nativeConnectionNecessaryForNativeStatements;
} }
@Override
public boolean isNativeConnectionNecessaryForNativeStatements() { public boolean isNativeConnectionNecessaryForNativeStatements() {
return this.nativeConnectionNecessaryForNativeStatements; return this.nativeConnectionNecessaryForNativeStatements;
} }
@ -114,6 +115,7 @@ public class SimpleNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
this.nativeConnectionNecessaryForNativePreparedStatements = nativeConnectionNecessary; this.nativeConnectionNecessaryForNativePreparedStatements = nativeConnectionNecessary;
} }
@Override
public boolean isNativeConnectionNecessaryForNativePreparedStatements() { public boolean isNativeConnectionNecessaryForNativePreparedStatements() {
return this.nativeConnectionNecessaryForNativePreparedStatements; return this.nativeConnectionNecessaryForNativePreparedStatements;
} }
@ -134,6 +136,7 @@ public class SimpleNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
this.nativeConnectionNecessaryForNativeCallableStatements = nativeConnectionNecessary; this.nativeConnectionNecessaryForNativeCallableStatements = nativeConnectionNecessary;
} }
@Override
public boolean isNativeConnectionNecessaryForNativeCallableStatements() { public boolean isNativeConnectionNecessaryForNativeCallableStatements() {
return this.nativeConnectionNecessaryForNativeCallableStatements; return this.nativeConnectionNecessaryForNativeCallableStatements;
} }

View File

@ -70,6 +70,7 @@ public class WebLogicNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Return <code>true</code>, as WebLogic returns wrapped Statements. * Return <code>true</code>, as WebLogic returns wrapped Statements.
*/ */
@Override
public boolean isNativeConnectionNecessaryForNativeStatements() { public boolean isNativeConnectionNecessaryForNativeStatements() {
return true; return true;
} }
@ -77,6 +78,7 @@ public class WebLogicNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Return <code>true</code>, as WebLogic returns wrapped PreparedStatements. * Return <code>true</code>, as WebLogic returns wrapped PreparedStatements.
*/ */
@Override
public boolean isNativeConnectionNecessaryForNativePreparedStatements() { public boolean isNativeConnectionNecessaryForNativePreparedStatements() {
return true; return true;
} }
@ -84,6 +86,7 @@ public class WebLogicNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Return <code>true</code>, as WebLogic returns wrapped CallableStatements. * Return <code>true</code>, as WebLogic returns wrapped CallableStatements.
*/ */
@Override
public boolean isNativeConnectionNecessaryForNativeCallableStatements() { public boolean isNativeConnectionNecessaryForNativeCallableStatements() {
return true; return true;
} }
@ -91,6 +94,7 @@ public class WebLogicNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Retrieve the Connection via WebLogic's <code>getVendorConnection</code> method. * Retrieve the Connection via WebLogic's <code>getVendorConnection</code> method.
*/ */
@Override
protected Connection doGetNativeConnection(Connection con) throws SQLException { protected Connection doGetNativeConnection(Connection con) throws SQLException {
if (this.jdbcExtensionClass.isAssignableFrom(con.getClass())) { if (this.jdbcExtensionClass.isAssignableFrom(con.getClass())) {
return (Connection) ReflectionUtils.invokeJdbcMethod(this.getVendorConnectionMethod, con); return (Connection) ReflectionUtils.invokeJdbcMethod(this.getVendorConnectionMethod, con);

View File

@ -73,6 +73,7 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Return <code>true</code>, as WebSphere returns wrapped Statements. * Return <code>true</code>, as WebSphere returns wrapped Statements.
*/ */
@Override
public boolean isNativeConnectionNecessaryForNativeStatements() { public boolean isNativeConnectionNecessaryForNativeStatements() {
return true; return true;
} }
@ -80,6 +81,7 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Return <code>true</code>, as WebSphere returns wrapped PreparedStatements. * Return <code>true</code>, as WebSphere returns wrapped PreparedStatements.
*/ */
@Override
public boolean isNativeConnectionNecessaryForNativePreparedStatements() { public boolean isNativeConnectionNecessaryForNativePreparedStatements() {
return true; return true;
} }
@ -87,6 +89,7 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Return <code>true</code>, as WebSphere returns wrapped CallableStatements. * Return <code>true</code>, as WebSphere returns wrapped CallableStatements.
*/ */
@Override
public boolean isNativeConnectionNecessaryForNativeCallableStatements() { public boolean isNativeConnectionNecessaryForNativeCallableStatements() {
return true; return true;
} }
@ -94,6 +97,7 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/** /**
* Retrieve the Connection via WebSphere's <code>getNativeConnection</code> method. * Retrieve the Connection via WebSphere's <code>getNativeConnection</code> method.
*/ */
@Override
protected Connection doGetNativeConnection(Connection con) throws SQLException { protected Connection doGetNativeConnection(Connection con) throws SQLException {
if (this.webSphere5ConnectionClass.isAssignableFrom(con.getClass())) { if (this.webSphere5ConnectionClass.isAssignableFrom(con.getClass())) {
return (Connection) ReflectionUtils.invokeJdbcMethod( return (Connection) ReflectionUtils.invokeJdbcMethod(

View File

@ -46,6 +46,7 @@ public class XAPoolNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
* Return <code>true</code>, as CoreStatement does not allow access to the * Return <code>true</code>, as CoreStatement does not allow access to the
* underlying Connection. * underlying Connection.
*/ */
@Override
public boolean isNativeConnectionNecessaryForNativeStatements() { public boolean isNativeConnectionNecessaryForNativeStatements() {
return true; return true;
} }
@ -54,10 +55,12 @@ public class XAPoolNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
* Return <code>true</code>, as CoreCallableStatement does not allow access to the * Return <code>true</code>, as CoreCallableStatement does not allow access to the
* underlying Connection. * underlying Connection.
*/ */
@Override
public boolean isNativeConnectionNecessaryForNativeCallableStatements() { public boolean isNativeConnectionNecessaryForNativeCallableStatements() {
return true; return true;
} }
@Override
protected Connection doGetNativeConnection(Connection con) throws SQLException { protected Connection doGetNativeConnection(Connection con) throws SQLException {
if (con instanceof CoreConnection) { if (con instanceof CoreConnection) {
return ((CoreConnection) con).con; return ((CoreConnection) con).con;
@ -65,6 +68,7 @@ public class XAPoolNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
return con; return con;
} }
@Override
public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException { public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException {
if (ps instanceof CorePreparedStatement) { if (ps instanceof CorePreparedStatement) {
return ((CorePreparedStatement) ps).ps; return ((CorePreparedStatement) ps).ps;

View File

@ -90,6 +90,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public SqlXmlValue newSqlXmlValue(final String value) { public SqlXmlValue newSqlXmlValue(final String value) {
return new AbstractJdbc4SqlXmlValue() { return new AbstractJdbc4SqlXmlValue() {
@Override
protected void provideXml(SQLXML xmlObject) throws SQLException, IOException { protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
xmlObject.setString(value); xmlObject.setString(value);
} }
@ -98,6 +99,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public SqlXmlValue newSqlXmlValue(final XmlBinaryStreamProvider provider) { public SqlXmlValue newSqlXmlValue(final XmlBinaryStreamProvider provider) {
return new AbstractJdbc4SqlXmlValue() { return new AbstractJdbc4SqlXmlValue() {
@Override
protected void provideXml(SQLXML xmlObject) throws SQLException, IOException { protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
provider.provideXml(xmlObject.setBinaryStream()); provider.provideXml(xmlObject.setBinaryStream());
} }
@ -106,6 +108,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public SqlXmlValue newSqlXmlValue(final XmlCharacterStreamProvider provider) { public SqlXmlValue newSqlXmlValue(final XmlCharacterStreamProvider provider) {
return new AbstractJdbc4SqlXmlValue() { return new AbstractJdbc4SqlXmlValue() {
@Override
protected void provideXml(SQLXML xmlObject) throws SQLException, IOException { protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
provider.provideXml(xmlObject.setCharacterStream()); provider.provideXml(xmlObject.setCharacterStream());
} }
@ -114,6 +117,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public SqlXmlValue newSqlXmlValue(final Class resultClass, final XmlResultProvider provider) { public SqlXmlValue newSqlXmlValue(final Class resultClass, final XmlResultProvider provider) {
return new AbstractJdbc4SqlXmlValue() { return new AbstractJdbc4SqlXmlValue() {
@Override
protected void provideXml(SQLXML xmlObject) throws SQLException, IOException { protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
provider.provideXml(xmlObject.setResult(resultClass)); provider.provideXml(xmlObject.setResult(resultClass));
} }
@ -122,6 +126,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public SqlXmlValue newSqlXmlValue(final Document document) { public SqlXmlValue newSqlXmlValue(final Document document) {
return new AbstractJdbc4SqlXmlValue() { return new AbstractJdbc4SqlXmlValue() {
@Override
protected void provideXml(SQLXML xmlObject) throws SQLException, IOException { protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
((DOMResult) xmlObject.setResult(DOMResult.class)).setNode(document); ((DOMResult) xmlObject.setResult(DOMResult.class)).setNode(document);
} }