mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
完善测试
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@822 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
package com.alibaba.druid.pool;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -24,7 +23,6 @@ import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.sql.ConnectionEventListener;
|
||||
import javax.sql.PooledConnection;
|
||||
import javax.sql.StatementEventListener;
|
||||
|
||||
import com.alibaba.druid.util.JdbcUtils;
|
||||
@@ -32,7 +30,7 @@ import com.alibaba.druid.util.JdbcUtils;
|
||||
/**
|
||||
* @author wenshao<szujobs@hotmail.com>
|
||||
*/
|
||||
public final class ConnectionHolder implements PooledConnection {
|
||||
public final class ConnectionHolder {
|
||||
|
||||
private final DruidAbstractDataSource dataSource;
|
||||
private final Connection conn;
|
||||
@@ -151,29 +149,4 @@ public final class ConnectionHolder implements PooledConnection {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws SQLException {
|
||||
this.reset();
|
||||
JdbcUtils.close(this.conn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConnectionEventListener(ConnectionEventListener listener) {
|
||||
connectionEventListeners.add(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeConnectionEventListener(ConnectionEventListener listener) {
|
||||
connectionEventListeners.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStatementEventListener(StatementEventListener listener) {
|
||||
statementEventListeners.add(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeStatementEventListener(StatementEventListener listener) {
|
||||
statementEventListeners.remove(listener);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,6 +397,12 @@ public class ConnectionTest4 extends TestCase {
|
||||
stmt.close();
|
||||
}
|
||||
|
||||
conn.getConnectionHolder().toString();
|
||||
conn.getConnectionHolder().setLastActiveTimeMillis(0);
|
||||
conn.getConnectionHolder().toString();
|
||||
conn.getConnectionHolder().getUseCount();
|
||||
conn.getConnectionHolder().getTimeMillis();
|
||||
|
||||
conn.close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user