com.github.davidmoten.rx.jdbc.ConnectionProviderNonClosing Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxjava-jdbc Show documentation
Show all versions of rxjava-jdbc Show documentation
rx-java Observables for jdbc
The newest version!
package com.github.davidmoten.rx.jdbc;
import java.sql.Connection;
/**
* Wraps a single {@link Connection} so that calls to {@link Connection#close()}
* are ignored.
*/
final class ConnectionProviderNonClosing implements ConnectionProvider {
private final Connection con;
/**
* Constructor.
*
* @param con
* wrapped connection that will not be closed by this class
*/
public ConnectionProviderNonClosing(Connection con) {
this.con = con;
}
@Override
public Connection get() {
return new ConnectionNonClosing(con);
}
@Override
public void close() {
// do nothing
}
}