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
17c5cbce
Commit
17c5cbce
authored
Feb 13, 2020
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
a9e5ba27
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
JdbcTemplate.java
src/main/java/com/egolm/common/jdbc/JdbcTemplate.java
+29
-7
No files found.
src/main/java/com/egolm/common/jdbc/JdbcTemplate.java
View file @
17c5cbce
...
@@ -552,7 +552,29 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
...
@@ -552,7 +552,29 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
});
});
}
}
public
List
<
Object
>
exec
(
final
String
sql
,
Map
<
Integer
,
Object
>
out
,
final
Object
...
args
)
{
public
static
class
OutParameter
{
private
final
int
index
;
private
final
int
type
;
private
Object
value
;
public
OutParameter
(
int
index
,
int
type
)
{
this
.
index
=
index
;
this
.
type
=
type
;
}
public
int
getIndex
()
{
return
index
;
}
public
int
getType
()
{
return
type
;
}
public
Object
getValue
()
{
return
value
;
}
public
void
setValue
(
Object
value
)
{
this
.
value
=
value
;
}
}
public
List
<
Object
>
exec
(
final
String
sql
,
List
<
OutParameter
>
outs
,
final
Object
...
args
)
{
showSql
(
sql
,
args
);
showSql
(
sql
,
args
);
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
{
...
@@ -560,9 +582,9 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
...
@@ -560,9 +582,9 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
cs
.
setObject
(
i
+
1
,
args
[
i
]);
cs
.
setObject
(
i
+
1
,
args
[
i
]);
}
}
if
(
out
!=
null
&&
out
.
size
()
>
0
)
{
if
(
out
s
!=
null
&&
outs
.
size
()
>
0
)
{
for
(
Integer
key
:
out
.
keySet
()
)
{
for
(
OutParameter
out
:
outs
)
{
cs
.
registerOutParameter
(
key
,
(
Integer
)
out
.
get
(
key
));
cs
.
registerOutParameter
(
out
.
getIndex
(),
out
.
getType
(
));
}
}
}
}
return
cs
;
return
cs
;
...
@@ -585,9 +607,9 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
...
@@ -585,9 +607,9 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
cs
.
getMoreResults
();
cs
.
getMoreResults
();
}
}
}
}
if
(
out
!=
null
&&
out
.
size
()
>
0
)
{
if
(
out
s
!=
null
&&
outs
.
size
()
>
0
)
{
for
(
Integer
key:
out
.
keySet
()
)
{
for
(
OutParameter
out
:
outs
)
{
out
.
put
(
key
,
cs
.
getObject
((
Integer
)
key
));
out
.
setValue
(
cs
.
getObject
(
out
.
getIndex
()
));
}
}
}
}
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