org.javasimon.jdbcx4.SimonPooledConnection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javasimon-jdbc41 Show documentation
Show all versions of javasimon-jdbc41 Show documentation
Java Simon JDBC 4.1 (Java SE 7) proxy driver - must be compiled with JDK 1.7
package org.javasimon.jdbcx4;
import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.ConnectionEventListener;
import javax.sql.PooledConnection;
import javax.sql.StatementEventListener;
import org.javasimon.jdbc4.SimonConnection;
/**
* Simon implementation of PooledConnection
, needed for
* Simon ConnectionPollDataSource implementation.
*
* All method invokes its real implementation.
*
* See the {@link org.javasimon.jdbcx4 package description} for more
* information.
*
* @author Radovan Sninsky
* @author Richard "Virgo" Richter
* @since 2.4
*/
public class SimonPooledConnection implements PooledConnection {
private final PooledConnection pooledConn;
private final String prefix;
/**
* Class constructor.
*
* @param connection real pooled connection
* @param prefix Simon prefix
*/
public SimonPooledConnection(PooledConnection connection, String prefix) {
this.pooledConn = connection;
this.prefix = prefix;
}
@Override
public final Connection getConnection() throws SQLException {
return new SimonConnection(pooledConn.getConnection(), prefix);
}
@Override
public final void close() throws SQLException {
pooledConn.close();
}
@Override
public final void addConnectionEventListener(ConnectionEventListener listener) {
pooledConn.addConnectionEventListener(listener);
}
@Override
public final void removeConnectionEventListener(ConnectionEventListener listener) {
pooledConn.removeConnectionEventListener(listener);
}
@Override
public void addStatementEventListener(StatementEventListener listener) {
pooledConn.addStatementEventListener(listener);
}
@Override
public void removeStatementEventListener(StatementEventListener listener) {
pooledConn.removeStatementEventListener(listener);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy