Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
common
Commits
40cae730
Commit
40cae730
authored
Feb 20, 2020
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
9c04b9f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
JdbcTemplate.java
src/main/java/com/egolm/common/jdbc/JdbcTemplate.java
+14
-12
No files found.
src/main/java/com/egolm/common/jdbc/JdbcTemplate.java
View file @
40cae730
...
@@ -487,18 +487,13 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
...
@@ -487,18 +487,13 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
public
ResultMutil
executeMutil
(
final
String
sql
,
final
Object
...
args
)
{
public
ResultMutil
executeMutil
(
final
String
sql
,
final
Object
...
args
)
{
showSql
(
sql
,
args
);
showSql
(
sql
,
args
);
Map
<
Integer
,
OutParameter
>
out
=
new
HashMap
<
Integer
,
OutParameter
>();
return
super
.
execute
(
new
CallableStatementCreator
()
{
return
super
.
execute
(
new
CallableStatementCreator
()
{
public
CallableStatement
createCallableStatement
(
final
Connection
con
)
throws
SQLException
{
public
CallableStatement
createCallableStatement
(
final
Connection
con
)
throws
SQLException
{
final
CallableStatement
cs
=
con
.
prepareCall
(
sql
);
final
CallableStatement
cs
=
con
.
prepareCall
(
sql
);
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
Integer
index
=
i
+
1
;
Integer
index
=
i
+
1
;
Object
arg
=
args
[
i
];
Object
arg
=
args
[
i
];
if
(
arg
!=
null
&&
arg
instanceof
OutParameter
)
{
cs
.
setObject
(
index
,
arg
);
out
.
put
(
index
,
(
OutParameter
)
arg
);
}
else
{
cs
.
setObject
(
index
,
arg
);
}
}
}
return
cs
;
return
cs
;
}
}
...
@@ -521,11 +516,6 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
...
@@ -521,11 +516,6 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
cs
.
getMoreResults
();
cs
.
getMoreResults
();
}
}
}
}
if
(
out
.
size
()
>
0
)
{
for
(
Integer
key
:
out
.
keySet
())
{
out
.
get
(
key
).
setValue
(
cs
.
getObject
(
key
));
}
}
return
new
ResultMutil
(
datas
,
counts
);
return
new
ResultMutil
(
datas
,
counts
);
}
}
});
});
...
@@ -533,11 +523,18 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
...
@@ -533,11 +523,18 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
public
List
<
Object
>
exec
(
final
String
sql
,
final
Object
...
args
)
{
public
List
<
Object
>
exec
(
final
String
sql
,
final
Object
...
args
)
{
showSql
(
sql
,
args
);
showSql
(
sql
,
args
);
Map
<
Integer
,
OutParameter
>
out
=
new
HashMap
<
Integer
,
OutParameter
>();
return
super
.
execute
(
new
CallableStatementCreator
()
{
return
super
.
execute
(
new
CallableStatementCreator
()
{
public
CallableStatement
createCallableStatement
(
final
Connection
con
)
throws
SQLException
{
public
CallableStatement
createCallableStatement
(
final
Connection
con
)
throws
SQLException
{
final
CallableStatement
cs
=
con
.
prepareCall
(
sql
);
final
CallableStatement
cs
=
con
.
prepareCall
(
sql
);
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
cs
.
setObject
(
i
+
1
,
args
[
i
]);
Integer
index
=
i
+
1
;
Object
arg
=
args
[
i
];
if
(
arg
!=
null
&&
arg
instanceof
OutParameter
)
{
out
.
put
(
index
,
(
OutParameter
)
arg
);
}
else
{
cs
.
setObject
(
index
,
arg
);
}
}
}
return
cs
;
return
cs
;
}
}
...
@@ -559,6 +556,11 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
...
@@ -559,6 +556,11 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
cs
.
getMoreResults
();
cs
.
getMoreResults
();
}
}
}
}
if
(
out
.
size
()
>
0
)
{
for
(
Integer
key
:
out
.
keySet
())
{
out
.
get
(
key
).
setValue
(
cs
.
getObject
(
key
));
}
}
return
datas
;
return
datas
;
}
}
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment