Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Meiracle
spring-framework
提交
b62652ac
S
spring-framework
项目概览
Meiracle
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
b62652ac
编写于
10月 14, 2013
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reduced "getParameterType call not supported" log message to single line
Issue: SPR-10185 (cherry picked from commit
41f041e6
)
上级
fce02d94
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
18 deletion
+12
-18
spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
.../org/springframework/jdbc/core/StatementCreatorUtils.java
+12
-18
未找到文件。
spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
浏览文件 @
b62652ac
...
...
@@ -120,8 +120,7 @@ public abstract class StatementCreatorUtils {
* @param inValue the value to set
* @throws SQLException if thrown by PreparedStatement methods
*/
public
static
void
setParameterValue
(
PreparedStatement
ps
,
int
paramIndex
,
SqlParameter
param
,
Object
inValue
)
public
static
void
setParameterValue
(
PreparedStatement
ps
,
int
paramIndex
,
SqlParameter
param
,
Object
inValue
)
throws
SQLException
{
setParameterValueInternal
(
ps
,
paramIndex
,
param
.
getSqlType
(),
param
.
getTypeName
(),
param
.
getScale
(),
inValue
);
...
...
@@ -137,8 +136,7 @@ public abstract class StatementCreatorUtils {
* @throws SQLException if thrown by PreparedStatement methods
* @see SqlTypeValue
*/
public
static
void
setParameterValue
(
PreparedStatement
ps
,
int
paramIndex
,
int
sqlType
,
Object
inValue
)
public
static
void
setParameterValue
(
PreparedStatement
ps
,
int
paramIndex
,
int
sqlType
,
Object
inValue
)
throws
SQLException
{
setParameterValueInternal
(
ps
,
paramIndex
,
sqlType
,
null
,
null
,
inValue
);
...
...
@@ -156,9 +154,8 @@ public abstract class StatementCreatorUtils {
* @throws SQLException if thrown by PreparedStatement methods
* @see SqlTypeValue
*/
public
static
void
setParameterValue
(
PreparedStatement
ps
,
int
paramIndex
,
int
sqlType
,
String
typeName
,
Object
inValue
)
throws
SQLException
{
public
static
void
setParameterValue
(
PreparedStatement
ps
,
int
paramIndex
,
int
sqlType
,
String
typeName
,
Object
inValue
)
throws
SQLException
{
setParameterValueInternal
(
ps
,
paramIndex
,
sqlType
,
typeName
,
null
,
inValue
);
}
...
...
@@ -177,9 +174,8 @@ public abstract class StatementCreatorUtils {
* @throws SQLException if thrown by PreparedStatement methods
* @see SqlTypeValue
*/
private
static
void
setParameterValueInternal
(
PreparedStatement
ps
,
int
paramIndex
,
int
sqlType
,
String
typeName
,
Integer
scale
,
Object
inValue
)
throws
SQLException
{
private
static
void
setParameterValueInternal
(
PreparedStatement
ps
,
int
paramIndex
,
int
sqlType
,
String
typeName
,
Integer
scale
,
Object
inValue
)
throws
SQLException
{
String
typeNameToUse
=
typeName
;
int
sqlTypeToUse
=
sqlType
;
...
...
@@ -190,8 +186,7 @@ public abstract class StatementCreatorUtils {
SqlParameterValue
parameterValue
=
(
SqlParameterValue
)
inValue
;
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Overriding type info with runtime info from SqlParameterValue: column index "
+
paramIndex
+
", SQL type "
+
parameterValue
.
getSqlType
()
+
", Type name "
+
parameterValue
.
getTypeName
());
", SQL type "
+
parameterValue
.
getSqlType
()
+
", type name "
+
parameterValue
.
getTypeName
());
}
if
(
parameterValue
.
getSqlType
()
!=
SqlTypeValue
.
TYPE_UNKNOWN
)
{
sqlTypeToUse
=
parameterValue
.
getSqlType
();
...
...
@@ -221,9 +216,7 @@ public abstract class StatementCreatorUtils {
* Set the specified PreparedStatement parameter to null,
* respecting database-specific peculiarities.
*/
private
static
void
setNull
(
PreparedStatement
ps
,
int
paramIndex
,
int
sqlType
,
String
typeName
)
throws
SQLException
{
private
static
void
setNull
(
PreparedStatement
ps
,
int
paramIndex
,
int
sqlType
,
String
typeName
)
throws
SQLException
{
if
(
sqlType
==
SqlTypeValue
.
TYPE_UNKNOWN
)
{
boolean
useSetObject
=
false
;
sqlType
=
Types
.
NULL
;
...
...
@@ -231,9 +224,10 @@ public abstract class StatementCreatorUtils {
sqlType
=
ps
.
getParameterMetaData
().
getParameterType
(
paramIndex
);
}
catch
(
Throwable
ex
)
{
logger
.
debug
(
"JDBC 3.0 getParameterType call not supported"
,
ex
);
// JDBC driver not compliant with JDBC 3.0
// -> proceed with database-specific checks
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"JDBC 3.0 getParameterType call not supported - using fallback method instead: "
+
ex
);
}
// JDBC driver not compliant with JDBC 3.0 -> proceed with database-specific checks
try
{
DatabaseMetaData
dbmd
=
ps
.
getConnection
().
getMetaData
();
String
databaseProductName
=
dbmd
.
getDatabaseProductName
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录