View Javadoc
1   package com.github.davidmoten.rx.jdbc;
2   
3   import java.sql.Connection;
4   
5   /**
6    * Wraps a single {@link Connection} so that calls to {@link Connection#close()}
7    * are ignored.
8    */
9   final class ConnectionProviderNonClosing implements ConnectionProvider {
10  
11      private final Connection con;
12  
13      /**
14       * Constructor.
15       * 
16       * @param con wrapped connection that will not be closed by this class
17       */
18      public ConnectionProviderNonClosing(Connection con) {
19          this.con = con;
20      }
21  
22      @Override
23      public Connection get() {
24          return new ConnectionNonClosing(con);
25      }
26  
27      @Override
28      public void close() {
29          // do nothing
30      }
31  
32  }