| Revision | 90 (tree) |
|---|---|
| Time | 2015-08-23 14:59:02 |
| Author | t_nakayama1971 |
(empty log message)
| @@ -33,8 +33,6 @@ | ||
| 33 | 33 | |
| 34 | 34 | import org.apache.logging.log4j.LogManager; |
| 35 | 35 | |
| 36 | -import project.common.master.AppConfig; | |
| 37 | - | |
| 38 | 36 | import com.sun.mail.smtp.SMTPAddressFailedException; |
| 39 | 37 | import com.sun.mail.smtp.SMTPAddressSucceededException; |
| 40 | 38 |
| @@ -46,6 +44,7 @@ | ||
| 46 | 44 | import core.exception.ThrowableUtil; |
| 47 | 45 | import core.util.ArrayUtil; |
| 48 | 46 | import core.util.MojiUtil; |
| 47 | +import project.common.master.AppConfig; | |
| 49 | 48 | |
| 50 | 49 | /** |
| 51 | 50 | * メール送信クラス |
| @@ -446,8 +445,9 @@ | ||
| 446 | 445 | */ |
| 447 | 446 | private void setMailCtrl(final String id, final Connection conn) { |
| 448 | 447 | String query = QueryUtil.getSqlFromFile("SelectMailCtl", this.getClass()); |
| 449 | - try (PreparedStatement psmt = | |
| 450 | - QueryUtil.statementReadonly(conn, query, Collections.singletonMap("CtlId", id))) { | |
| 448 | + try (PreparedStatement psmt = QueryUtil.createStatement( | |
| 449 | + query, Collections.singletonMap("CtlId", id), | |
| 450 | + Jdbc.wrap(conn)::readonlyStatement)) { | |
| 451 | 451 | try (ResultSet rs = psmt.executeQuery()) { |
| 452 | 452 | if (rs.next()) { |
| 453 | 453 | this.subject = rs.getString("MAIL_SUBJECT_NAME"); |
| @@ -472,8 +472,9 @@ | ||
| 472 | 472 | private void setMailText(final String id, final Connection conn) { |
| 473 | 473 | |
| 474 | 474 | String query = QueryUtil.getSqlFromFile("SelectMailText", this.getClass()); |
| 475 | - try (PreparedStatement psmt = | |
| 476 | - QueryUtil.statementReadonly(conn, query, Collections.singletonMap("CtlId", id))) { | |
| 475 | + try (PreparedStatement psmt = QueryUtil.createStatement( | |
| 476 | + query, Collections.singletonMap("CtlId", id), | |
| 477 | + Jdbc.wrap(conn)::readonlyStatement)) { | |
| 477 | 478 | List<String> list = new ArrayList<>(); |
| 478 | 479 | try (ResultSet rs = psmt.executeQuery()) { |
| 479 | 480 | while (rs.next()) { |
| @@ -15,7 +15,6 @@ | ||
| 15 | 15 | import common.db.jdbc.Jdbc; |
| 16 | 16 | import common.master.IntervalTimer.IntervalCache; |
| 17 | 17 | import common.sql.QueryUtil; |
| 18 | - | |
| 19 | 18 | import core.exception.PhysicalException; |
| 20 | 19 | import core.exception.ThrowableUtil; |
| 21 | 20 | import core.util.ArrayUtil; |
| @@ -198,8 +197,9 @@ | ||
| 198 | 197 | |
| 199 | 198 | try (Jdbc conn = JdbcSource.getConnection()) { |
| 200 | 199 | String query = QueryUtil.getSqlFromFile(this.getClass().getName()); |
| 201 | - try (PreparedStatement psmt = QueryUtil.statementReadonly( | |
| 202 | - conn, query, Collections.singletonMap("FunctionId", id))) { | |
| 200 | + try (PreparedStatement psmt = QueryUtil.createStatement( | |
| 201 | + query, Collections.singletonMap("FunctionId", id), | |
| 202 | + Jdbc.wrap(conn)::readonlyStatement)) { | |
| 203 | 203 | String kid = null; |
| 204 | 204 | String kst = null; |
| 205 | 205 | List<String> value = new ArrayList<>(); |
| @@ -19,7 +19,6 @@ | ||
| 19 | 19 | import common.db.jdbc.Jdbc; |
| 20 | 20 | import common.master.IntervalTimer.IntervalCache; |
| 21 | 21 | import common.sql.QueryUtil; |
| 22 | - | |
| 23 | 22 | import core.config.Env; |
| 24 | 23 | import core.config.Factory; |
| 25 | 24 | import core.exception.PhysicalException; |
| @@ -309,8 +308,9 @@ | ||
| 309 | 308 | */ |
| 310 | 309 | private Map<String, String> getMessage(final Connection conn, final String code) { |
| 311 | 310 | String query = QueryUtil.getSqlFromFile("SelectMessage", this.getClass()); |
| 312 | - try (PreparedStatement psmt = QueryUtil.statementReadonly( | |
| 313 | - conn, query, Collections.singletonMap("MsgId", code))) { | |
| 311 | + try (PreparedStatement psmt = QueryUtil.createStatement( | |
| 312 | + query, Collections.singletonMap("MsgId", code), | |
| 313 | + Jdbc.wrap(conn)::readonlyStatement)) { | |
| 314 | 314 | return getMessage(psmt); |
| 315 | 315 | } catch (final SQLException ex) { |
| 316 | 316 | ThrowableUtil.error(ex); |
| @@ -16,8 +16,8 @@ | ||
| 16 | 16 | import java.util.concurrent.atomic.AtomicReference; |
| 17 | 17 | |
| 18 | 18 | import common.db.JdbcSource; |
| 19 | +import common.db.jdbc.Jdbc; | |
| 19 | 20 | import common.sql.QueryUtil; |
| 20 | - | |
| 21 | 21 | import core.exception.PhysicalException; |
| 22 | 22 | import core.exception.ThrowableUtil; |
| 23 | 23 |
| @@ -193,8 +193,9 @@ | ||
| 193 | 193 | private String getComment(final Connection conn, |
| 194 | 194 | final String table) throws SQLException { |
| 195 | 195 | String query = QueryUtil.getSqlFromFile("SelectTable", this.getClass()); |
| 196 | - try (PreparedStatement psmt = QueryUtil.statementReadonly( | |
| 197 | - conn, query, Collections.singletonMap("Relname", table))) { | |
| 196 | + try (PreparedStatement psmt = QueryUtil.createStatement( | |
| 197 | + query, Collections.singletonMap("Relname", table), | |
| 198 | + Jdbc.wrap(conn)::readonlyStatement)) { | |
| 198 | 199 | try (ResultSet rs = psmt.executeQuery()) { |
| 199 | 200 | if (rs.next()) { |
| 200 | 201 | return rs.getString("COMMENT"); |
| @@ -219,8 +220,8 @@ | ||
| 219 | 220 | map.put("Attname", col); |
| 220 | 221 | |
| 221 | 222 | String query = QueryUtil.getSqlFromFile("SelectComment", this.getClass()); |
| 222 | - try (PreparedStatement psmt = | |
| 223 | - QueryUtil.statementReadonly(conn, query, map)) { | |
| 223 | + try (PreparedStatement psmt = QueryUtil.createStatement( | |
| 224 | + query, map, Jdbc.wrap(conn)::readonlyStatement)) { | |
| 224 | 225 | try (ResultSet rs = psmt.executeQuery()) { |
| 225 | 226 | if (rs.next()) { |
| 226 | 227 | return rs.getString("COMMENT"); |