Skip to content

Commit

Permalink
0001237: JdbcSqlTransaction not logging sql and args for some methods
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 22, 2013
1 parent 7f71329 commit f6ec278
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -177,6 +177,7 @@ public T execute(Connection con) throws SQLException {
Statement stmt = null;
ResultSet rs = null;
try {
logSql(sql, args);
if (args != null && args.length > 0) {
PreparedStatement ps = con.prepareStatement(sql);
stmt = ps;
Expand Down Expand Up @@ -214,6 +215,7 @@ public List<T> execute(Connection c) throws SQLException {
PreparedStatement st = null;
ResultSet rs = null;
try {
logSql(sql, args);
st = c.prepareStatement(sql);
st.setQueryTimeout(jdbcSqlTemplate.getSettings().getQueryTimeout());
if (args != null) {
Expand Down Expand Up @@ -242,6 +244,7 @@ public Integer execute(Connection con) throws SQLException {
Statement stmt = null;
ResultSet rs = null;
try {
logSql(sql, null);
stmt = con.createStatement();
if (stmt.execute(sql)) {
rs = stmt.getResultSet();
Expand All @@ -264,6 +267,7 @@ public Integer execute(Connection con) throws SQLException {
PreparedStatement stmt = null;
ResultSet rs = null;
try {
logSql(sql, args);
stmt = con.prepareStatement(sql);
jdbcSqlTemplate.setValues(stmt, args, types, jdbcSqlTemplate.getLobHandler().getDefaultHandler());
if (stmt.execute()) {
Expand All @@ -287,6 +291,7 @@ public Integer execute(Connection con) throws SQLException {
PreparedStatement stmt = null;
ResultSet rs = null;
try {
logSql(sql, args);
stmt = con.prepareStatement(sql);
if (args != null && args.length > 0) {
jdbcSqlTemplate.setValues(stmt, args);
Expand Down

0 comments on commit f6ec278

Please sign in to comment.