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

future-architect / uroborosql / #867

03 Aug 2025 06:18PM UTC coverage: 88.253% (-1.6%) from 89.835%
#867

Pull #362

HidekiSugimoto189
#360 for master
Pull Request #362: cache DatabaseMetaData fixed value and Connection getSchema value. for master

136 of 325 new or added lines in 8 files covered. (41.85%)

2 existing lines in 1 file now uncovered.

8835 of 10011 relevant lines covered (88.25%)

0.88 hits per line

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

77.78
/src/main/java/jp/co/future/uroborosql/connection/DefaultConnectionSupplierImpl.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.connection;
8

9
import java.sql.Connection;
10

11
/**
12
 * デフォルトコネクション供給クラス<br>
13
 * コネクションを保持して返すだけの実装。<br>
14
 * 保持しているコネクションはクローズされないようWrapper経由で提供される。<br>
15
 *
16
 * @author H.Sugimoto
17
 */
18
public class DefaultConnectionSupplierImpl implements ConnectionSupplier {
19
        /**  コネクション */
20
        private final Connection connection;
21

22
        /**
23
         * コンストラクタ.
24
         *
25
         * @param connection コネクション
26
         */
27
        public DefaultConnectionSupplierImpl(final Connection connection) {
28
                this(connection, false);
1✔
29
        }
1✔
30

31
        /**
32
         * コンストラクタ.
33
         *
34
         * @param connection コネクション
35
         * @param cacheSchema スキーマ名をキャッシュするかどうか. キャッシュする場合は<code>true</code>.
36
         */
37
        public DefaultConnectionSupplierImpl(final Connection connection, final boolean cacheSchema) {
1✔
38
                this.connection = new MetadataCachedConnectionWrapper(new CloseIgnoringConnectionWrapper(connection),
1✔
39
                                cacheSchema);
40
        }
1✔
41

42
        /**
43
         * {@inheritDoc}
44
         *
45
         * @see jp.co.future.uroborosql.connection.ConnectionSupplier#getConnection()
46
         */
47
        @Override
48
        public Connection getConnection() {
49
                return connection;
1✔
50
        }
51

52
        /**
53
         * {@inheritDoc}
54
         *
55
         * @see jp.co.future.uroborosql.connection.ConnectionSupplier#getConnection(jp.co.future.uroborosql.connection.ConnectionContext)
56
         */
57
        @Override
58
        public Connection getConnection(final ConnectionContext ctx) {
59
                throw new UnsupportedOperationException();
1✔
60
        }
61

62
        /**
63
         * 保持しているConnectionにスキーマ名のキャッシュオプションを指定
64
         *
65
         * @param cache スキーマ名をキャッシュする場合は<code>true</code>
66
         */
67
        public void setCacheSchema(final boolean cache) {
NEW
68
                ((MetadataCachedConnectionWrapper) connection).setCacheSchema(cache);
×
NEW
69
        }
×
70
}
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

© 2026 Coveralls, Inc