Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
cdb36efb
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cdb36efb
编写于
10月 28, 2008
作者:
A
Arjen Poutsma
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added @Override and @Deprecated annotations to jdbc module
上级
aa607461
变更
64
隐藏空白更改
内联
并排
Showing
64 changed file
with
123 addition
and
0 deletion
+123
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/CannotGetJdbcConnectionException.java
...pringframework/jdbc/CannotGetJdbcConnectionException.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/JdbcUpdateAffectedIncorrectNumberOfRowsException.java
...dbc/JdbcUpdateAffectedIncorrectNumberOfRowsException.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/CallableStatementCreatorFactory.java
...gframework/jdbc/core/CallableStatementCreatorFactory.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java
...gframework/jdbc/core/PreparedStatementCreatorFactory.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/ResultSetSupportingSqlParameter.java
...gframework/jdbc/core/ResultSetSupportingSqlParameter.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/SqlInOutParameter.java
...java/org/springframework/jdbc/core/SqlInOutParameter.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnResultSet.java
...ava/org/springframework/jdbc/core/SqlReturnResultSet.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnUpdateCount.java
...a/org/springframework/jdbc/core/SqlReturnUpdateCount.java
+2
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/metadata/HsqlTableMetaDataProvider.java
...amework/jdbc/core/metadata/HsqlTableMetaDataProvider.java
+2
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/metadata/PostgresTableMetaDataProvider.java
...ork/jdbc/core/metadata/PostgresTableMetaDataProvider.java
+2
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/namedparam/BeanPropertySqlParameterSource.java
.../jdbc/core/namedparam/BeanPropertySqlParameterSource.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcDaoSupport.java
...rk/jdbc/core/namedparam/NamedParameterJdbcDaoSupport.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/namedparam/ParsedSql.java
...a/org/springframework/jdbc/core/namedparam/ParsedSql.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/simple/ParameterizedBeanPropertyRowMapper.java
.../jdbc/core/simple/ParameterizedBeanPropertyRowMapper.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/simple/ParameterizedSingleColumnRowMapper.java
.../jdbc/core/simple/ParameterizedSingleColumnRowMapper.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcDaoSupport.java
...pringframework/jdbc/core/simple/SimpleJdbcDaoSupport.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/support/JdbcDaoSupport.java
...org/springframework/jdbc/core/support/JdbcDaoSupport.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/ConnectionHolder.java
...org/springframework/jdbc/datasource/ConnectionHolder.java
+2
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceTransactionManager.java
...amework/jdbc/datasource/DataSourceTransactionManager.java
+9
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceUtils.java
.../org/springframework/jdbc/datasource/DataSourceUtils.java
+5
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/DriverManagerDataSource.java
...ingframework/jdbc/datasource/DriverManagerDataSource.java
+2
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/IsolationLevelDataSourceAdapter.java
...work/jdbc/datasource/IsolationLevelDataSourceAdapter.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/LazyConnectionDataSourceProxy.java
...mework/jdbc/datasource/LazyConnectionDataSourceProxy.java
+3
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/SimpleConnectionHandle.java
...ringframework/jdbc/datasource/SimpleConnectionHandle.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/SimpleDriverDataSource.java
...ringframework/jdbc/datasource/SimpleDriverDataSource.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/SingleConnectionDataSource.java
...framework/jdbc/datasource/SingleConnectionDataSource.java
+3
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy.java
...work/jdbc/datasource/TransactionAwareDataSourceProxy.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapter.java
...ork/jdbc/datasource/UserCredentialsDataSourceAdapter.java
+3
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/WebSphereDataSourceAdapter.java
...framework/jdbc/datasource/WebSphereDataSourceAdapter.java
+2
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/IsolationLevelDataSourceRouter.java
...dbc/datasource/lookup/IsolationLevelDataSourceRouter.java
+2
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/BatchSqlUpdate.java
.../java/org/springframework/jdbc/object/BatchSqlUpdate.java
+2
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/MappingSqlQuery.java
...java/org/springframework/jdbc/object/MappingSqlQuery.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/MappingSqlQueryWithParameters.java
...gframework/jdbc/object/MappingSqlQueryWithParameters.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/SqlCall.java
...rc/main/java/org/springframework/jdbc/object/SqlCall.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/SqlFunction.java
...ain/java/org/springframework/jdbc/object/SqlFunction.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/SqlOperation.java
...in/java/org/springframework/jdbc/object/SqlOperation.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/StoredProcedure.java
...java/org/springframework/jdbc/object/StoredProcedure.java
+2
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/UpdatableSqlQuery.java
...va/org/springframework/jdbc/object/UpdatableSqlQuery.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslator.java
...work/jdbc/support/SQLErrorCodeSQLExceptionTranslator.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java
...ramework/jdbc/support/SQLExceptionSubclassTranslator.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLStateSQLExceptionTranslator.java
...ramework/jdbc/support/SQLStateSQLExceptionTranslator.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/AbstractColumnMaxValueIncrementer.java
...upport/incrementer/AbstractColumnMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/AbstractSequenceMaxValueIncrementer.java
...port/incrementer/AbstractSequenceMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/DB2MainframeSequenceMaxValueIncrementer.java
.../incrementer/DB2MainframeSequenceMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/DB2SequenceMaxValueIncrementer.java
...c/support/incrementer/DB2SequenceMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/DerbyMaxValueIncrementer.java
...rk/jdbc/support/incrementer/DerbyMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/H2SequenceMaxValueIncrementer.java
...bc/support/incrementer/H2SequenceMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/HsqlMaxValueIncrementer.java
...ork/jdbc/support/incrementer/HsqlMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/HsqlSequenceMaxValueIncrementer.java
.../support/incrementer/HsqlSequenceMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/MySQLMaxValueIncrementer.java
...rk/jdbc/support/incrementer/MySQLMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/OracleSequenceMaxValueIncrementer.java
...upport/incrementer/OracleSequenceMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/PostgreSQLSequenceMaxValueIncrementer.java
...rt/incrementer/PostgreSQLSequenceMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/SqlServerMaxValueIncrementer.java
...dbc/support/incrementer/SqlServerMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/SybaseMaxValueIncrementer.java
...k/jdbc/support/incrementer/SybaseMaxValueIncrementer.java
+1
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/lob/SpringLobCreatorSynchronization.java
...ork/jdbc/support/lob/SpringLobCreatorSynchronization.java
+3
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/C3P0NativeJdbcExtractor.java
...work/jdbc/support/nativejdbc/C3P0NativeJdbcExtractor.java
+4
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/CommonsDbcpNativeJdbcExtractor.java
...bc/support/nativejdbc/CommonsDbcpNativeJdbcExtractor.java
+5
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/JBossNativeJdbcExtractor.java
...ork/jdbc/support/nativejdbc/JBossNativeJdbcExtractor.java
+5
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/Jdbc4NativeJdbcExtractor.java
...ork/jdbc/support/nativejdbc/Jdbc4NativeJdbcExtractor.java
+5
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/SimpleNativeJdbcExtractor.java
...rk/jdbc/support/nativejdbc/SimpleNativeJdbcExtractor.java
+3
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/WebLogicNativeJdbcExtractor.java
.../jdbc/support/nativejdbc/WebLogicNativeJdbcExtractor.java
+4
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/WebSphereNativeJdbcExtractor.java
...jdbc/support/nativejdbc/WebSphereNativeJdbcExtractor.java
+4
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/XAPoolNativeJdbcExtractor.java
...rk/jdbc/support/nativejdbc/XAPoolNativeJdbcExtractor.java
+4
-0
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/xml/Jdbc4SqlXmlHandler.java
.../springframework/jdbc/support/xml/Jdbc4SqlXmlHandler.java
+5
-0
未找到文件。
org.springframework.jdbc/src/main/java/org/springframework/jdbc/CannotGetJdbcConnectionException.java
浏览文件 @
cdb36efb
...
...
@@ -43,6 +43,7 @@ public class CannotGetJdbcConnectionException extends DataAccessResourceFailureE
* @deprecated since Spring 2.5, in favor of throwing an
* IllegalStateException in case of the driver not being found
*/
@Deprecated
public
CannotGetJdbcConnectionException
(
String
msg
,
ClassNotFoundException
ex
)
{
super
(
msg
,
ex
);
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/JdbcUpdateAffectedIncorrectNumberOfRowsException.java
浏览文件 @
cdb36efb
...
...
@@ -62,6 +62,7 @@ public class JdbcUpdateAffectedIncorrectNumberOfRowsException extends IncorrectU
return
this
.
actual
;
}
@Override
public
boolean
wasDataUpdated
()
{
return
(
getActualRowsAffected
()
>
0
);
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/CallableStatementCreatorFactory.java
浏览文件 @
cdb36efb
...
...
@@ -229,6 +229,7 @@ public class CallableStatementCreatorFactory {
}
}
@Override
public
String
toString
()
{
StringBuffer
buf
=
new
StringBuffer
(
"CallableStatementCreatorFactory.CallableStatementCreatorImpl: sql=["
);
buf
.
append
(
callString
).
append
(
"]; parameters="
).
append
(
this
.
inParameters
);
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java
浏览文件 @
cdb36efb
...
...
@@ -311,6 +311,7 @@ public class PreparedStatementCreatorFactory {
StatementCreatorUtils
.
cleanupParameters
(
this
.
parameters
);
}
@Override
public
String
toString
()
{
StringBuffer
buf
=
new
StringBuffer
(
"PreparedStatementCreatorFactory.PreparedStatementCreatorImpl: sql=["
);
buf
.
append
(
sql
).
append
(
"]; parameters="
).
append
(
this
.
parameters
);
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/ResultSetSupportingSqlParameter.java
浏览文件 @
cdb36efb
...
...
@@ -129,6 +129,7 @@ public class ResultSetSupportingSqlParameter extends SqlParameter {
/**
* <p>This implementation always returns <code>false</code>.
*/
@Override
public
boolean
isInputValueProvided
()
{
return
false
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/SqlInOutParameter.java
浏览文件 @
cdb36efb
...
...
@@ -105,6 +105,7 @@ public class SqlInOutParameter extends SqlOutParameter {
/**
* This implementation always returns <code>true</code>.
*/
@Override
public
boolean
isInputValueProvided
()
{
return
true
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnResultSet.java
浏览文件 @
cdb36efb
...
...
@@ -62,6 +62,7 @@ public class SqlReturnResultSet extends ResultSetSupportingSqlParameter {
* results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
* <p>This implementation always returns <code>true</code>.
*/
@Override
public
boolean
isResultsParameter
()
{
return
true
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnUpdateCount.java
浏览文件 @
cdb36efb
...
...
@@ -26,6 +26,7 @@ public class SqlReturnUpdateCount extends SqlParameter {
* before execution even if they are <code>null</code>.
* <p>This implementation always returns <code>false</code>.
*/
@Override
public
boolean
isInputValueProvided
()
{
return
false
;
}
...
...
@@ -35,6 +36,7 @@ public class SqlReturnUpdateCount extends SqlParameter {
* results preocessing of the CallableStatement.getMoreResults/getUpdateCount.
* <p>This implementation always returns <code>true</code>.
*/
@Override
public
boolean
isResultsParameter
()
{
return
true
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/metadata/HsqlTableMetaDataProvider.java
浏览文件 @
cdb36efb
...
...
@@ -33,11 +33,13 @@ public class HsqlTableMetaDataProvider extends GenericTableMetaDataProvider {
}
@Override
public
boolean
isGetGeneratedKeysSimulated
()
{
return
true
;
}
@Override
public
String
getSimpleQueryForGetGeneratedKey
(
String
tableName
,
String
keyColumnName
)
{
return
"select max(identity()) from "
+
tableName
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/metadata/PostgresTableMetaDataProvider.java
浏览文件 @
cdb36efb
...
...
@@ -17,6 +17,7 @@ public class PostgresTableMetaDataProvider extends GenericTableMetaDataProvider
}
@Override
public
boolean
isGetGeneratedKeysSimulated
()
{
if
(
getDatabaseVersion
().
compareTo
(
"8.2.0"
)
>=
0
)
{
return
true
;
...
...
@@ -28,6 +29,7 @@ public class PostgresTableMetaDataProvider extends GenericTableMetaDataProvider
}
@Override
public
String
getSimpleQueryForGetGeneratedKey
(
String
tableName
,
String
keyColumnName
)
{
return
"RETURNING "
+
keyColumnName
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/namedparam/BeanPropertySqlParameterSource.java
浏览文件 @
cdb36efb
...
...
@@ -91,6 +91,7 @@ public class BeanPropertySqlParameterSource extends AbstractSqlParameterSource {
* Derives a default SQL type from the corresponding property type.
* @see org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType
*/
@Override
public
int
getSqlType
(
String
paramName
)
{
int
sqlType
=
super
.
getSqlType
(
paramName
);
if
(
sqlType
!=
TYPE_UNKNOWN
)
{
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcDaoSupport.java
浏览文件 @
cdb36efb
...
...
@@ -34,6 +34,7 @@ public class NamedParameterJdbcDaoSupport extends JdbcDaoSupport {
/**
* Create a NamedParameterJdbcTemplate based on the configured JdbcTemplate.
*/
@Override
protected
void
initTemplateConfig
()
{
this
.
namedParameterJdbcTemplate
=
new
NamedParameterJdbcTemplate
(
getJdbcTemplate
());
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/namedparam/ParsedSql.java
浏览文件 @
cdb36efb
...
...
@@ -137,6 +137,7 @@ public class ParsedSql {
/**
* Exposes the original SQL String.
*/
@Override
public
String
toString
()
{
return
this
.
originalSql
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/simple/ParameterizedBeanPropertyRowMapper.java
浏览文件 @
cdb36efb
...
...
@@ -61,6 +61,7 @@ public class ParameterizedBeanPropertyRowMapper<T> extends BeanPropertyRowMapper
public
ParameterizedBeanPropertyRowMapper
()
{
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
T
mapRow
(
ResultSet
rs
,
int
rowNumber
)
throws
SQLException
{
return
(
T
)
super
.
mapRow
(
rs
,
rowNumber
);
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/simple/ParameterizedSingleColumnRowMapper.java
浏览文件 @
cdb36efb
...
...
@@ -48,6 +48,7 @@ public class ParameterizedSingleColumnRowMapper<T> extends SingleColumnRowMapper
public
ParameterizedSingleColumnRowMapper
()
{
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
T
mapRow
(
ResultSet
rs
,
int
rowNumber
)
throws
SQLException
{
return
(
T
)
super
.
mapRow
(
rs
,
rowNumber
);
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcDaoSupport.java
浏览文件 @
cdb36efb
...
...
@@ -36,6 +36,7 @@ public class SimpleJdbcDaoSupport extends JdbcDaoSupport {
/**
* Create a SimpleJdbcTemplate based on the configured JdbcTemplate.
*/
@Override
protected
void
initTemplateConfig
()
{
this
.
simpleJdbcTemplate
=
new
SimpleJdbcTemplate
(
getJdbcTemplate
());
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/support/JdbcDaoSupport.java
浏览文件 @
cdb36efb
...
...
@@ -106,6 +106,7 @@ public abstract class JdbcDaoSupport extends DaoSupport {
protected
void
initTemplateConfig
()
{
}
@Override
protected
void
checkDaoConfig
()
{
if
(
this
.
jdbcTemplate
==
null
)
{
throw
new
IllegalArgumentException
(
"'dataSource' or 'jdbcTemplate' is required"
);
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/ConnectionHolder.java
浏览文件 @
cdb36efb
...
...
@@ -186,6 +186,7 @@ public class ConnectionHolder extends ResourceHolderSupport {
* JDO 2.0 DataStoreConnections, for example.
* @see org.springframework.orm.jdo.DefaultJdoDialect#getJdbcConnection
*/
@Override
public
void
released
()
{
super
.
released
();
if
(
this
.
currentConnection
!=
null
)
{
...
...
@@ -195,6 +196,7 @@ public class ConnectionHolder extends ResourceHolderSupport {
}
@Override
public
void
clear
()
{
super
.
clear
();
this
.
transactionActive
=
false
;
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceTransactionManager.java
浏览文件 @
cdb36efb
...
...
@@ -173,6 +173,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
return
getDataSource
();
}
@Override
protected
Object
doGetTransaction
()
{
DataSourceTransactionObject
txObject
=
new
DataSourceTransactionObject
();
txObject
.
setSavepointAllowed
(
isNestedTransactionAllowed
());
...
...
@@ -182,6 +183,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
return
txObject
;
}
@Override
protected
boolean
isExistingTransaction
(
Object
transaction
)
{
DataSourceTransactionObject
txObject
=
(
DataSourceTransactionObject
)
transaction
;
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.
*/
@Override
protected
void
doBegin
(
Object
transaction
,
TransactionDefinition
definition
)
{
DataSourceTransactionObject
txObject
=
(
DataSourceTransactionObject
)
transaction
;
Connection
con
=
null
;
...
...
@@ -239,6 +242,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
}
}
@Override
protected
Object
doSuspend
(
Object
transaction
)
{
DataSourceTransactionObject
txObject
=
(
DataSourceTransactionObject
)
transaction
;
txObject
.
setConnectionHolder
(
null
);
...
...
@@ -247,11 +251,13 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
return
conHolder
;
}
@Override
protected
void
doResume
(
Object
transaction
,
Object
suspendedResources
)
{
ConnectionHolder
conHolder
=
(
ConnectionHolder
)
suspendedResources
;
TransactionSynchronizationManager
.
bindResource
(
this
.
dataSource
,
conHolder
);
}
@Override
protected
void
doCommit
(
DefaultTransactionStatus
status
)
{
DataSourceTransactionObject
txObject
=
(
DataSourceTransactionObject
)
status
.
getTransaction
();
Connection
con
=
txObject
.
getConnectionHolder
().
getConnection
();
...
...
@@ -266,6 +272,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
}
}
@Override
protected
void
doRollback
(
DefaultTransactionStatus
status
)
{
DataSourceTransactionObject
txObject
=
(
DataSourceTransactionObject
)
status
.
getTransaction
();
Connection
con
=
txObject
.
getConnectionHolder
().
getConnection
();
...
...
@@ -280,6 +287,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
}
}
@Override
protected
void
doSetRollbackOnly
(
DefaultTransactionStatus
status
)
{
DataSourceTransactionObject
txObject
=
(
DataSourceTransactionObject
)
status
.
getTransaction
();
if
(
status
.
isDebug
())
{
...
...
@@ -289,6 +297,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
txObject
.
setRollbackOnly
();
}
@Override
protected
void
doCleanupAfterCompletion
(
Object
transaction
)
{
DataSourceTransactionObject
txObject
=
(
DataSourceTransactionObject
)
transaction
;
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceUtils.java
浏览文件 @
cdb36efb
...
...
@@ -391,10 +391,12 @@ public abstract class DataSourceUtils {
this
.
order
=
getConnectionSynchronizationOrder
(
dataSource
);
}
@Override
public
int
getOrder
()
{
return
this
.
order
;
}
@Override
public
void
suspend
()
{
if
(
this
.
holderActive
)
{
TransactionSynchronizationManager
.
unbindResource
(
this
.
dataSource
);
...
...
@@ -409,12 +411,14 @@ public abstract class DataSourceUtils {
}
}
@Override
public
void
resume
()
{
if
(
this
.
holderActive
)
{
TransactionSynchronizationManager
.
bindResource
(
this
.
dataSource
,
this
.
connectionHolder
);
}
}
@Override
public
void
beforeCompletion
()
{
// Release Connection early if the holder is not open anymore
// (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
)
{
// If we haven't closed the Connection in beforeCompletion,
// close it now. The holder might have been used for other
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/DriverManagerDataSource.java
浏览文件 @
cdb36efb
...
...
@@ -119,6 +119,7 @@ public class DriverManagerDataSource extends AbstractDriverBasedDataSource {
* If you need to register a new driver, consider using
* {@link SimpleDriverDataSource} instead.
*/
@Deprecated
public
DriverManagerDataSource
(
String
driverClassName
,
String
url
,
String
username
,
String
password
)
{
setDriverClassName
(
driverClassName
);
setUrl
(
url
);
...
...
@@ -157,6 +158,7 @@ public class DriverManagerDataSource extends AbstractDriverBasedDataSource {
}
@Override
protected
Connection
getConnectionFromDriver
(
Properties
props
)
throws
SQLException
{
String
url
=
getUrl
();
if
(
logger
.
isDebugEnabled
())
{
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/IsolationLevelDataSourceAdapter.java
浏览文件 @
cdb36efb
...
...
@@ -123,6 +123,7 @@ public class IsolationLevelDataSourceAdapter extends UserCredentialsDataSourceAd
* @see #getCurrentIsolationLevel()
* @see #getCurrentReadOnlyFlag()
*/
@Override
protected
Connection
doGetConnection
(
String
username
,
String
password
)
throws
SQLException
{
Connection
con
=
super
.
doGetConnection
(
username
,
password
);
Boolean
readOnlyToUse
=
getCurrentReadOnlyFlag
();
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/LazyConnectionDataSourceProxy.java
浏览文件 @
cdb36efb
...
...
@@ -153,6 +153,7 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
}
@Override
public
void
afterPropertiesSet
()
{
super
.
afterPropertiesSet
();
...
...
@@ -216,6 +217,7 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
* @return a lazy Connection handle
* @see ConnectionProxy#getTargetConnection()
*/
@Override
public
Connection
getConnection
()
throws
SQLException
{
return
(
Connection
)
Proxy
.
newProxyInstance
(
ConnectionProxy
.
class
.
getClassLoader
(),
...
...
@@ -233,6 +235,7 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
* @return a lazy Connection handle
* @see ConnectionProxy#getTargetConnection()
*/
@Override
public
Connection
getConnection
(
String
username
,
String
password
)
throws
SQLException
{
return
(
Connection
)
Proxy
.
newProxyInstance
(
ConnectionProxy
.
class
.
getClassLoader
(),
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/SimpleConnectionHandle.java
浏览文件 @
cdb36efb
...
...
@@ -56,6 +56,7 @@ public class SimpleConnectionHandle implements ConnectionHandle {
}
@Override
public
String
toString
()
{
return
"SimpleConnectionHandle: "
+
this
.
connection
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/SimpleDriverDataSource.java
浏览文件 @
cdb36efb
...
...
@@ -129,6 +129,7 @@ public class SimpleDriverDataSource extends AbstractDriverBasedDataSource {
}
@Override
protected
Connection
getConnectionFromDriver
(
Properties
props
)
throws
SQLException
{
Driver
driver
=
getDriver
();
String
url
=
getUrl
();
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/SingleConnectionDataSource.java
浏览文件 @
cdb36efb
...
...
@@ -94,6 +94,7 @@ public class SingleConnectionDataSource extends DriverManagerDataSource
* directly, set up the Driver class manually before invoking this DataSource.
* @see java.sql.DriverManager#getConnection(String, String, String)
*/
@Deprecated
public
SingleConnectionDataSource
(
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
{
synchronized
(
this
.
connectionMonitor
)
{
if
(
this
.
connection
==
null
)
{
...
...
@@ -197,6 +199,7 @@ public class SingleConnectionDataSource extends DriverManagerDataSource
* with a single Connection. Returns the single Connection if given
* the same username and password; throws a SQLException else.
*/
@Override
public
Connection
getConnection
(
String
username
,
String
password
)
throws
SQLException
{
if
(
ObjectUtils
.
nullSafeEquals
(
username
,
getUsername
())
&&
ObjectUtils
.
nullSafeEquals
(
password
,
getPassword
()))
{
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy.java
浏览文件 @
cdb36efb
...
...
@@ -121,6 +121,7 @@ public class TransactionAwareDataSourceProxy extends DelegatingDataSource {
* @see DataSourceUtils#doGetConnection
* @see ConnectionProxy#getTargetConnection
*/
@Override
public
Connection
getConnection
()
throws
SQLException
{
DataSource
ds
=
getTargetDataSource
();
Assert
.
state
(
ds
!=
null
,
"'targetDataSource' is required"
);
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapter.java
浏览文件 @
cdb36efb
...
...
@@ -124,6 +124,7 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource {
* <p>Delegates to {@link #doGetConnection(String, String)} with the
* determined credentials as parameters.
*/
@Override
public
Connection
getConnection
()
throws
SQLException
{
JdbcUserCredentials
threadCredentials
=
(
JdbcUserCredentials
)
this
.
threadBoundCredentials
.
get
();
if
(
threadCredentials
!=
null
)
{
...
...
@@ -138,6 +139,7 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource {
* Simply delegates to {@link #doGetConnection(String, String)},
* keeping the given user credentials as-is.
*/
@Override
public
Connection
getConnection
(
String
username
,
String
password
)
throws
SQLException
{
return
doGetConnection
(
username
,
password
);
}
...
...
@@ -178,6 +180,7 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource {
this
.
password
=
password
;
}
@Override
public
String
toString
()
{
return
"JdbcUserCredentials[username='"
+
this
.
username
+
"',password='"
+
this
.
password
+
"']"
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/WebSphereDataSourceAdapter.java
浏览文件 @
cdb36efb
...
...
@@ -113,6 +113,7 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter
* Checks that the specified 'targetDataSource' actually is
* a WebSphere WSDataSource.
*/
@Override
public
void
afterPropertiesSet
()
{
super
.
afterPropertiesSet
();
...
...
@@ -129,6 +130,7 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter
* @see #createConnectionSpec
* @see com.ibm.websphere.rsadapter.WSDataSource#getConnection(com.ibm.websphere.rsadapter.JDBCConnectionSpec)
*/
@Override
protected
Connection
doGetConnection
(
String
username
,
String
password
)
throws
SQLException
{
// Create JDBCConnectionSpec using current isolation level value and read-only flag.
Object
connSpec
=
createConnectionSpec
(
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/IsolationLevelDataSourceRouter.java
浏览文件 @
cdb36efb
...
...
@@ -100,6 +100,7 @@ public class IsolationLevelDataSourceRouter extends AbstractRoutingDataSource {
* as well as isolation level names as defined on the
* {@link org.springframework.transaction.TransactionDefinition TransactionDefinition interface}.
*/
@Override
protected
Object
resolveSpecifiedLookupKey
(
Object
lookupKey
)
{
if
(
lookupKey
instanceof
Integer
)
{
return
(
Integer
)
lookupKey
;
...
...
@@ -117,6 +118,7 @@ public class IsolationLevelDataSourceRouter extends AbstractRoutingDataSource {
}
}
@Override
protected
Object
determineCurrentLookupKey
()
{
return
TransactionSynchronizationManager
.
getCurrentTransactionIsolationLevel
();
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/BatchSqlUpdate.java
浏览文件 @
cdb36efb
...
...
@@ -138,6 +138,7 @@ public class BatchSqlUpdate extends SqlUpdate {
/**
* BatchSqlUpdate does not support BLOB or CLOB parameters.
*/
@Override
protected
boolean
supportsLobParameters
()
{
return
false
;
}
...
...
@@ -157,6 +158,7 @@ public class BatchSqlUpdate extends SqlUpdate {
* executed by this method)
* @see #flush
*/
@Override
public
int
update
(
Object
[]
params
)
throws
DataAccessException
{
validateParameters
(
params
);
this
.
parameterQueue
.
add
(
params
.
clone
());
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/MappingSqlQuery.java
浏览文件 @
cdb36efb
...
...
@@ -58,6 +58,7 @@ public abstract class MappingSqlQuery extends MappingSqlQueryWithParameters {
* template method, ignoring parameters.
* @see #mapRow(ResultSet, int)
*/
@Override
protected
final
Object
mapRow
(
ResultSet
rs
,
int
rowNum
,
Object
[]
parameters
,
Map
context
)
throws
SQLException
{
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/MappingSqlQueryWithParameters.java
浏览文件 @
cdb36efb
...
...
@@ -70,6 +70,7 @@ public abstract class MappingSqlQueryWithParameters extends SqlQuery {
* Implementation of protected abstract method. This invokes the subclass's
* implementation of the mapRow() method.
*/
@Override
protected
RowMapper
newRowMapper
(
Object
[]
parameters
,
Map
context
)
{
return
new
RowMapperImpl
(
parameters
,
context
);
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/SqlCall.java
浏览文件 @
cdb36efb
...
...
@@ -124,6 +124,7 @@ public abstract class SqlCall extends RdbmsOperation {
* based on our declared parameters.
* @see RdbmsOperation#compileInternal()
*/
@Override
protected
final
void
compileInternal
()
{
if
(
isSqlReadyForUse
())
{
this
.
callString
=
getSql
();
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/SqlFunction.java
浏览文件 @
cdb36efb
...
...
@@ -128,6 +128,7 @@ public class SqlFunction extends MappingSqlQuery {
* single row returned by the function. If there are a different number
* of rows returned, this is treated as an error.
*/
@Override
protected
Object
mapRow
(
ResultSet
rs
,
int
rowNum
)
throws
SQLException
{
return
this
.
rowMapper
.
mapRow
(
rs
,
rowNum
);
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/SqlOperation.java
浏览文件 @
cdb36efb
...
...
@@ -51,6 +51,7 @@ public abstract class SqlOperation extends RdbmsOperation {
* Overridden method to configure the PreparedStatementCreatorFactory
* based on our declared parameters.
*/
@Override
protected
final
void
compileInternal
()
{
this
.
preparedStatementFactory
=
new
PreparedStatementCreatorFactory
(
getSql
(),
getDeclaredParameters
());
this
.
preparedStatementFactory
.
setResultSetType
(
getResultSetType
());
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/StoredProcedure.java
浏览文件 @
cdb36efb
...
...
@@ -75,6 +75,7 @@ public abstract class StoredProcedure extends SqlCall {
* StoredProcedure parameter Maps are by default allowed to contain
* additional entries that are not actually used as parameters.
*/
@Override
protected
boolean
allowsUnusedParameters
()
{
return
true
;
}
...
...
@@ -90,6 +91,7 @@ public abstract class StoredProcedure extends SqlCall {
* Names are purely used to help mapping.
* @param param parameter object
*/
@Override
public
void
declareParameter
(
SqlParameter
param
)
throws
InvalidDataAccessApiUsageException
{
if
(
param
.
getName
()
==
null
)
{
throw
new
InvalidDataAccessApiUsageException
(
"Parameters to stored procedures must have names as well as types"
);
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/object/UpdatableSqlQuery.java
浏览文件 @
cdb36efb
...
...
@@ -58,6 +58,7 @@ public abstract class UpdatableSqlQuery extends SqlQuery {
* Implementation of the superclass template method. This invokes the subclass's
* implementation of the <code>updateRow()</code> method.
*/
@Override
protected
RowMapper
newRowMapper
(
Object
[]
parameters
,
Map
context
)
{
return
new
RowMapperImpl
(
context
);
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslator.java
浏览文件 @
cdb36efb
...
...
@@ -170,6 +170,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep
}
@Override
protected
DataAccessException
doTranslate
(
String
task
,
String
sql
,
SQLException
ex
)
{
SQLException
sqlEx
=
ex
;
if
(
sqlEx
instanceof
BatchUpdateException
&&
sqlEx
.
getNextException
()
!=
null
)
{
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java
浏览文件 @
cdb36efb
...
...
@@ -61,6 +61,7 @@ public class SQLExceptionSubclassTranslator extends AbstractFallbackSQLException
setFallbackTranslator
(
new
SQLStateSQLExceptionTranslator
());
}
@Override
protected
DataAccessException
doTranslate
(
String
task
,
String
sql
,
SQLException
ex
)
{
if
(
ex
instanceof
SQLTransientException
)
{
if
(
ex
instanceof
SQLTransactionRollbackException
)
{
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/SQLStateSQLExceptionTranslator.java
浏览文件 @
cdb36efb
...
...
@@ -86,6 +86,7 @@ public class SQLStateSQLExceptionTranslator extends AbstractFallbackSQLException
}
@Override
protected
DataAccessException
doTranslate
(
String
task
,
String
sql
,
SQLException
ex
)
{
String
sqlState
=
getSqlState
(
ex
);
if
(
sqlState
!=
null
&&
sqlState
.
length
()
>=
2
)
{
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/AbstractColumnMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -87,6 +87,7 @@ public abstract class AbstractColumnMaxValueIncrementer extends AbstractDataFiel
return
this
.
cacheSize
;
}
@Override
public
void
afterPropertiesSet
()
{
super
.
afterPropertiesSet
();
if
(
this
.
columnName
==
null
)
{
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/AbstractSequenceMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -59,6 +59,7 @@ public abstract class AbstractSequenceMaxValueIncrementer extends AbstractDataFi
/**
* Executes the SQL as specified by {@link #getSequenceQuery()}.
*/
@Override
protected
long
getNextKey
()
throws
DataAccessException
{
Connection
con
=
DataSourceUtils
.
getConnection
(
getDataSource
());
Statement
stmt
=
null
;
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/DB2MainframeSequenceMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -46,6 +46,7 @@ public class DB2MainframeSequenceMaxValueIncrementer extends AbstractSequenceMax
}
@Override
protected
String
getSequenceQuery
()
{
return
"select next value for "
+
getIncrementerName
()
+
" from sysibm.sysdummy1"
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/DB2SequenceMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -46,6 +46,7 @@ public class DB2SequenceMaxValueIncrementer extends AbstractSequenceMaxValueIncr
}
@Override
protected
String
getSequenceQuery
()
{
return
"values nextval for "
+
getIncrementerName
();
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/DerbyMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -126,6 +126,7 @@ public class DerbyMaxValueIncrementer extends AbstractColumnMaxValueIncrementer
}
@Override
protected
synchronized
long
getNextKey
()
throws
DataAccessException
{
if
(
this
.
nextValueIndex
<
0
||
this
.
nextValueIndex
>=
getCacheSize
())
{
/*
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/H2SequenceMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -44,6 +44,7 @@ public class H2SequenceMaxValueIncrementer extends AbstractSequenceMaxValueIncre
}
@Override
protected
String
getSequenceQuery
()
{
return
"select "
+
getIncrementerName
()
+
".nextval from dual"
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/HsqlMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -84,6 +84,7 @@ public class HsqlMaxValueIncrementer extends AbstractColumnMaxValueIncrementer {
}
@Override
protected
synchronized
long
getNextKey
()
throws
DataAccessException
{
if
(
this
.
nextValueIndex
<
0
||
this
.
nextValueIndex
>=
getCacheSize
())
{
/*
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/HsqlSequenceMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -49,6 +49,7 @@ public class HsqlSequenceMaxValueIncrementer extends AbstractSequenceMaxValueInc
}
@Override
protected
String
getSequenceQuery
()
{
return
"call next value for "
+
getIncrementerName
();
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/MySQLMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -85,6 +85,7 @@ public class MySQLMaxValueIncrementer extends AbstractColumnMaxValueIncrementer
}
@Override
protected
synchronized
long
getNextKey
()
throws
DataAccessException
{
if
(
this
.
maxId
==
this
.
nextId
)
{
/*
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/OracleSequenceMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -45,6 +45,7 @@ public class OracleSequenceMaxValueIncrementer extends AbstractSequenceMaxValueI
}
@Override
protected
String
getSequenceQuery
()
{
return
"select "
+
getIncrementerName
()
+
".nextval from dual"
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/PostgreSQLSequenceMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -44,6 +44,7 @@ public class PostgreSQLSequenceMaxValueIncrementer extends AbstractSequenceMaxVa
}
@Override
protected
String
getSequenceQuery
()
{
return
"select nextval('"
+
getIncrementerName
()
+
"')"
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/SqlServerMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -73,6 +73,7 @@ public class SqlServerMaxValueIncrementer extends AbstractColumnMaxValueIncremen
}
@Override
protected
synchronized
long
getNextKey
()
throws
DataAccessException
{
if
(
this
.
nextValueIndex
<
0
||
this
.
nextValueIndex
>=
getCacheSize
())
{
/*
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/incrementer/SybaseMaxValueIncrementer.java
浏览文件 @
cdb36efb
...
...
@@ -73,6 +73,7 @@ public class SybaseMaxValueIncrementer extends AbstractColumnMaxValueIncrementer
}
@Override
protected
synchronized
long
getNextKey
()
throws
DataAccessException
{
if
(
this
.
nextValueIndex
<
0
||
this
.
nextValueIndex
>=
getCacheSize
())
{
/*
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/lob/SpringLobCreatorSynchronization.java
浏览文件 @
cdb36efb
...
...
@@ -55,11 +55,13 @@ public class SpringLobCreatorSynchronization extends TransactionSynchronizationA
this
.
lobCreator
=
lobCreator
;
}
@Override
public
int
getOrder
()
{
return
LOB_CREATOR_SYNCHRONIZATION_ORDER
;
}
@Override
public
void
beforeCompletion
()
{
// Close the LobCreator early if possible, to avoid issues with strict JTA
// implementations that issue warnings when doing JDBC operations after
...
...
@@ -68,6 +70,7 @@ public class SpringLobCreatorSynchronization extends TransactionSynchronizationA
this
.
lobCreator
.
close
();
}
@Override
public
void
afterCompletion
(
int
status
)
{
if
(!
this
.
beforeCompletionCalled
)
{
// beforeCompletion not called before (probably because of flushing on commit
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/C3P0NativeJdbcExtractor.java
浏览文件 @
cdb36efb
...
...
@@ -71,14 +71,17 @@ public class C3P0NativeJdbcExtractor extends NativeJdbcExtractorAdapter {
}
@Override
public
boolean
isNativeConnectionNecessaryForNativeStatements
()
{
return
true
;
}
@Override
public
boolean
isNativeConnectionNecessaryForNativePreparedStatements
()
{
return
true
;
}
@Override
public
boolean
isNativeConnectionNecessaryForNativeCallableStatements
()
{
return
true
;
}
...
...
@@ -89,6 +92,7 @@ public class C3P0NativeJdbcExtractor extends NativeJdbcExtractorAdapter {
* raw Connection (which is otherwise not directly supported by C3P0).
* @see #getRawConnection
*/
@Override
protected
Connection
doGetNativeConnection
(
Connection
con
)
throws
SQLException
{
if
(
con
instanceof
C3P0ProxyConnection
)
{
C3P0ProxyConnection
cpCon
=
(
C3P0ProxyConnection
)
con
;
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/CommonsDbcpNativeJdbcExtractor.java
浏览文件 @
cdb36efb
...
...
@@ -84,22 +84,27 @@ public class CommonsDbcpNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
}
@Override
protected
Connection
doGetNativeConnection
(
Connection
con
)
throws
SQLException
{
return
(
Connection
)
getInnermostDelegate
(
con
);
}
@Override
public
Statement
getNativeStatement
(
Statement
stmt
)
throws
SQLException
{
return
(
Statement
)
getInnermostDelegate
(
stmt
);
}
@Override
public
PreparedStatement
getNativePreparedStatement
(
PreparedStatement
ps
)
throws
SQLException
{
return
(
PreparedStatement
)
getNativeStatement
(
ps
);
}
@Override
public
CallableStatement
getNativeCallableStatement
(
CallableStatement
cs
)
throws
SQLException
{
return
(
CallableStatement
)
getNativeStatement
(
cs
);
}
@Override
public
ResultSet
getNativeResultSet
(
ResultSet
rs
)
throws
SQLException
{
return
(
ResultSet
)
getInnermostDelegate
(
rs
);
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/JBossNativeJdbcExtractor.java
浏览文件 @
cdb36efb
...
...
@@ -93,6 +93,7 @@ public class JBossNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Retrieve the Connection via JBoss' <code>getUnderlyingConnection</code> method.
*/
@Override
protected
Connection
doGetNativeConnection
(
Connection
con
)
throws
SQLException
{
if
(
this
.
wrappedConnectionClass
.
isAssignableFrom
(
con
.
getClass
()))
{
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.
*/
@Override
public
Statement
getNativeStatement
(
Statement
stmt
)
throws
SQLException
{
if
(
this
.
wrappedStatementClass
.
isAssignableFrom
(
stmt
.
getClass
()))
{
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.
*/
@Override
public
PreparedStatement
getNativePreparedStatement
(
PreparedStatement
ps
)
throws
SQLException
{
return
(
PreparedStatement
)
getNativeStatement
(
ps
);
}
...
...
@@ -120,6 +123,7 @@ public class JBossNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Retrieve the Connection via JBoss' <code>getUnderlyingStatement</code> method.
*/
@Override
public
CallableStatement
getNativeCallableStatement
(
CallableStatement
cs
)
throws
SQLException
{
return
(
CallableStatement
)
getNativeStatement
(
cs
);
}
...
...
@@ -127,6 +131,7 @@ public class JBossNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Retrieve the Connection via JBoss' <code>getUnderlyingResultSet</code> method.
*/
@Override
public
ResultSet
getNativeResultSet
(
ResultSet
rs
)
throws
SQLException
{
if
(
this
.
wrappedResultSetClass
.
isAssignableFrom
(
rs
.
getClass
()))
{
return
(
ResultSet
)
ReflectionUtils
.
invokeJdbcMethod
(
this
.
getUnderlyingResultSetMethod
,
rs
);
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/Jdbc4NativeJdbcExtractor.java
浏览文件 @
cdb36efb
...
...
@@ -40,22 +40,27 @@ import java.sql.Statement;
*/
public
class
Jdbc4NativeJdbcExtractor
extends
NativeJdbcExtractorAdapter
{
@Override
protected
Connection
doGetNativeConnection
(
Connection
con
)
throws
SQLException
{
return
(
Connection
)
con
.
unwrap
(
Connection
.
class
);
}
@Override
public
Statement
getNativeStatement
(
Statement
stmt
)
throws
SQLException
{
return
(
Statement
)
stmt
.
unwrap
(
Statement
.
class
);
}
@Override
public
PreparedStatement
getNativePreparedStatement
(
PreparedStatement
ps
)
throws
SQLException
{
return
(
PreparedStatement
)
ps
.
unwrap
(
PreparedStatement
.
class
);
}
@Override
public
CallableStatement
getNativeCallableStatement
(
CallableStatement
cs
)
throws
SQLException
{
return
(
CallableStatement
)
cs
.
unwrap
(
CallableStatement
.
class
);
}
@Override
public
ResultSet
getNativeResultSet
(
ResultSet
rs
)
throws
SQLException
{
return
(
ResultSet
)
rs
.
unwrap
(
ResultSet
.
class
);
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/SimpleNativeJdbcExtractor.java
浏览文件 @
cdb36efb
...
...
@@ -94,6 +94,7 @@ public class SimpleNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
this
.
nativeConnectionNecessaryForNativeStatements
=
nativeConnectionNecessaryForNativeStatements
;
}
@Override
public
boolean
isNativeConnectionNecessaryForNativeStatements
()
{
return
this
.
nativeConnectionNecessaryForNativeStatements
;
}
...
...
@@ -114,6 +115,7 @@ public class SimpleNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
this
.
nativeConnectionNecessaryForNativePreparedStatements
=
nativeConnectionNecessary
;
}
@Override
public
boolean
isNativeConnectionNecessaryForNativePreparedStatements
()
{
return
this
.
nativeConnectionNecessaryForNativePreparedStatements
;
}
...
...
@@ -134,6 +136,7 @@ public class SimpleNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
this
.
nativeConnectionNecessaryForNativeCallableStatements
=
nativeConnectionNecessary
;
}
@Override
public
boolean
isNativeConnectionNecessaryForNativeCallableStatements
()
{
return
this
.
nativeConnectionNecessaryForNativeCallableStatements
;
}
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/WebLogicNativeJdbcExtractor.java
浏览文件 @
cdb36efb
...
...
@@ -70,6 +70,7 @@ public class WebLogicNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Return <code>true</code>, as WebLogic returns wrapped Statements.
*/
@Override
public
boolean
isNativeConnectionNecessaryForNativeStatements
()
{
return
true
;
}
...
...
@@ -77,6 +78,7 @@ public class WebLogicNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Return <code>true</code>, as WebLogic returns wrapped PreparedStatements.
*/
@Override
public
boolean
isNativeConnectionNecessaryForNativePreparedStatements
()
{
return
true
;
}
...
...
@@ -84,6 +86,7 @@ public class WebLogicNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Return <code>true</code>, as WebLogic returns wrapped CallableStatements.
*/
@Override
public
boolean
isNativeConnectionNecessaryForNativeCallableStatements
()
{
return
true
;
}
...
...
@@ -91,6 +94,7 @@ public class WebLogicNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Retrieve the Connection via WebLogic's <code>getVendorConnection</code> method.
*/
@Override
protected
Connection
doGetNativeConnection
(
Connection
con
)
throws
SQLException
{
if
(
this
.
jdbcExtensionClass
.
isAssignableFrom
(
con
.
getClass
()))
{
return
(
Connection
)
ReflectionUtils
.
invokeJdbcMethod
(
this
.
getVendorConnectionMethod
,
con
);
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/WebSphereNativeJdbcExtractor.java
浏览文件 @
cdb36efb
...
...
@@ -73,6 +73,7 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Return <code>true</code>, as WebSphere returns wrapped Statements.
*/
@Override
public
boolean
isNativeConnectionNecessaryForNativeStatements
()
{
return
true
;
}
...
...
@@ -80,6 +81,7 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Return <code>true</code>, as WebSphere returns wrapped PreparedStatements.
*/
@Override
public
boolean
isNativeConnectionNecessaryForNativePreparedStatements
()
{
return
true
;
}
...
...
@@ -87,6 +89,7 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Return <code>true</code>, as WebSphere returns wrapped CallableStatements.
*/
@Override
public
boolean
isNativeConnectionNecessaryForNativeCallableStatements
()
{
return
true
;
}
...
...
@@ -94,6 +97,7 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
/**
* Retrieve the Connection via WebSphere's <code>getNativeConnection</code> method.
*/
@Override
protected
Connection
doGetNativeConnection
(
Connection
con
)
throws
SQLException
{
if
(
this
.
webSphere5ConnectionClass
.
isAssignableFrom
(
con
.
getClass
()))
{
return
(
Connection
)
ReflectionUtils
.
invokeJdbcMethod
(
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/XAPoolNativeJdbcExtractor.java
浏览文件 @
cdb36efb
...
...
@@ -46,6 +46,7 @@ public class XAPoolNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
* Return <code>true</code>, as CoreStatement does not allow access to the
* underlying Connection.
*/
@Override
public
boolean
isNativeConnectionNecessaryForNativeStatements
()
{
return
true
;
}
...
...
@@ -54,10 +55,12 @@ public class XAPoolNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
* Return <code>true</code>, as CoreCallableStatement does not allow access to the
* underlying Connection.
*/
@Override
public
boolean
isNativeConnectionNecessaryForNativeCallableStatements
()
{
return
true
;
}
@Override
protected
Connection
doGetNativeConnection
(
Connection
con
)
throws
SQLException
{
if
(
con
instanceof
CoreConnection
)
{
return
((
CoreConnection
)
con
).
con
;
...
...
@@ -65,6 +68,7 @@ public class XAPoolNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
return
con
;
}
@Override
public
PreparedStatement
getNativePreparedStatement
(
PreparedStatement
ps
)
throws
SQLException
{
if
(
ps
instanceof
CorePreparedStatement
)
{
return
((
CorePreparedStatement
)
ps
).
ps
;
...
...
org.springframework.jdbc/src/main/java/org/springframework/jdbc/support/xml/Jdbc4SqlXmlHandler.java
浏览文件 @
cdb36efb
...
...
@@ -90,6 +90,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public
SqlXmlValue
newSqlXmlValue
(
final
String
value
)
{
return
new
AbstractJdbc4SqlXmlValue
()
{
@Override
protected
void
provideXml
(
SQLXML
xmlObject
)
throws
SQLException
,
IOException
{
xmlObject
.
setString
(
value
);
}
...
...
@@ -98,6 +99,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public
SqlXmlValue
newSqlXmlValue
(
final
XmlBinaryStreamProvider
provider
)
{
return
new
AbstractJdbc4SqlXmlValue
()
{
@Override
protected
void
provideXml
(
SQLXML
xmlObject
)
throws
SQLException
,
IOException
{
provider
.
provideXml
(
xmlObject
.
setBinaryStream
());
}
...
...
@@ -106,6 +108,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public
SqlXmlValue
newSqlXmlValue
(
final
XmlCharacterStreamProvider
provider
)
{
return
new
AbstractJdbc4SqlXmlValue
()
{
@Override
protected
void
provideXml
(
SQLXML
xmlObject
)
throws
SQLException
,
IOException
{
provider
.
provideXml
(
xmlObject
.
setCharacterStream
());
}
...
...
@@ -114,6 +117,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public
SqlXmlValue
newSqlXmlValue
(
final
Class
resultClass
,
final
XmlResultProvider
provider
)
{
return
new
AbstractJdbc4SqlXmlValue
()
{
@Override
protected
void
provideXml
(
SQLXML
xmlObject
)
throws
SQLException
,
IOException
{
provider
.
provideXml
(
xmlObject
.
setResult
(
resultClass
));
}
...
...
@@ -122,6 +126,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
public
SqlXmlValue
newSqlXmlValue
(
final
Document
document
)
{
return
new
AbstractJdbc4SqlXmlValue
()
{
@Override
protected
void
provideXml
(
SQLXML
xmlObject
)
throws
SQLException
,
IOException
{
((
DOMResult
)
xmlObject
.
setResult
(
DOMResult
.
class
)).
setNode
(
document
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录