• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

future-architect / uroborosql / #786

25 Sep 2024 03:41PM UTC coverage: 90.073% (-0.5%) from 90.525%
#786

push

web-flow
revise log level. (#337)

25 of 36 new or added lines in 6 files covered. (69.44%)

36 existing lines in 8 files now uncovered.

8683 of 9640 relevant lines covered (90.07%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/src/main/java/jp/co/future/uroborosql/parameter/ReaderParameter.java
1
/**
2
 * Copyright (c) 2017-present, Future Corporation
3
 *
4
 * This source code is licensed under the MIT license found in the
5
 * LICENSE file in the root directory of this source tree.
6
 */
7
package jp.co.future.uroborosql.parameter;
8

9
import java.io.Reader;
10
import java.sql.JDBCType;
11
import java.sql.PreparedStatement;
12
import java.sql.SQLException;
13

14
import jp.co.future.uroborosql.parameter.mapper.BindParameterMapperManager;
15

16
/**
17
 * ストリームパラメータオブジェクト。<br>
18
 * ストリームパラメータ情報を保持する。<br>
19
 *
20
 * @author H.Sugimoto
21
 */
22
public class ReaderParameter extends Parameter {
23

24
        /**
25
         * ストリーム
26
         */
27
        protected Reader reader;
28

29
        /**
30
         * ストリーム長
31
         */
32
        protected int len = -1;
1✔
33

34
        /**
35
         * コンストラクタ。
36
         *
37
         * @param parameterName パラメータ名
38
         * @param reader ストリーム
39
         */
40
        public ReaderParameter(final String parameterName, final Reader reader) {
41
                this(parameterName, reader, -1);
1✔
42
        }
1✔
43

44
        /**
45
         * コンストラクタ。
46
         *
47
         * @param parameterName パラメータ名
48
         * @param reader ストリーム
49
         * @param len ストリーム長
50
         */
51
        public ReaderParameter(final String parameterName, final Reader reader, final int len) {
52
                super(parameterName, "[CLOB]", JDBCType.CLOB);
1✔
53
                this.reader = reader;
1✔
54
                this.len = len;
1✔
55
        }
1✔
56

57
        /**
58
         * {@inheritDoc}
59
         *
60
         * @see jp.co.future.uroborosql.parameter.Parameter#setParameter(java.sql.PreparedStatement, int, jp.co.future.uroborosql.parameter.mapper.BindParameterMapperManager)
61
         */
62
        @Override
63
        public int setParameter(final PreparedStatement preparedStatement, final int index,
64
                        final BindParameterMapperManager parameterMapperManager) throws SQLException {
65
                return setReaderParameter(preparedStatement, index);
1✔
66
        }
67

68
        /**
69
         * ステートメントにストリームパラメータを登録。
70
         *
71
         * @param preparedStatement ステートメント
72
         * @param index パラメータインデックス
73
         * @return 次のパラメータインデックス
74
         * @throws SQLException SQL例外
75
         */
76
        protected int setReaderParameter(final PreparedStatement preparedStatement, int index) throws SQLException {
77
                if (len > -1) {
1✔
78
                        preparedStatement.setCharacterStream(index, reader, len);
×
79
                } else {
80
                        preparedStatement.setCharacterStream(index, reader);
1✔
81
                }
82
                parameterLog(index);
1✔
83
                index++;
1✔
84

85
                return index;
1✔
86
        }
87

88
        /**
89
         * {@inheritDoc}
90
         *
91
         * @see jp.co.future.uroborosql.parameter.Parameter#toString()
92
         */
93
        @Override
94
        public String toString() {
UNCOV
95
                return "Parameter name[" + parameterName + "], Value[" + reader.toString() + "], SQL type[" + sqlType + "]";
×
96
        }
97

98
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc