Java 类com.mysql.jdbc.jdbc2.optional.ConnectionWrapper 实例源码

项目:the-vigilantes    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    this.rs = connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:OpenVertretung    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    this.rs = connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:ProyectoPacientes    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    this.rs = connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:BibliotecaPS    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    this.rs = connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:Geometry-wars    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    this.rs = connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:TPKB    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:cloudera-cli-scripts    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:SMPT42    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:group-five    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:locaviewer    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:locaviewer    文件:PooledConnectionRegressionTest.java   
/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);

    createTable("testPacketTooLarge", "(field1 LONGBLOB)");

    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");

    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();

    int maxAllowedPacket = this.rs.getInt(2);

    int numChars = (int) (maxAllowedPacket * 1.2);

    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);

    try {
        pstmtFromPool.executeUpdate();
        fail("Expecting PacketTooLargeException");
    } catch (PacketTooBigException ptbe) {
        // We're expecting this one...
    }

    // This should still work okay, even though the last query on the same connection didn't...
    connFromPool.createStatement().executeQuery("SELECT 1");

    assertTrue(this.connectionErrorEventCount == 0);
    assertTrue(this.closeEventCount == 0);
}
项目:the-vigilantes    文件:JDBC4PreparedStatementWrapper.java   
public JDBC4PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:the-vigilantes    文件:JDBC42CallableStatementWrapper.java   
public JDBC42CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:the-vigilantes    文件:JDBC4CallableStatementWrapper.java   
public JDBC4CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:the-vigilantes    文件:JDBC4StatementWrapper.java   
public JDBC4StatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, Statement toWrap) {
    super(c, conn, toWrap);
}
项目:the-vigilantes    文件:JDBC42PreparedStatementWrapper.java   
public JDBC42PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:OpenVertretung    文件:JDBC4PreparedStatementWrapper.java   
public JDBC4PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:OpenVertretung    文件:JDBC42CallableStatementWrapper.java   
public JDBC42CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:OpenVertretung    文件:JDBC4CallableStatementWrapper.java   
public JDBC4CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:OpenVertretung    文件:JDBC4StatementWrapper.java   
public JDBC4StatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, Statement toWrap) {
    super(c, conn, toWrap);
}
项目:OpenVertretung    文件:JDBC42PreparedStatementWrapper.java   
public JDBC42PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:lams    文件:JDBC4PreparedStatementWrapper.java   
public JDBC4PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:lams    文件:JDBC42CallableStatementWrapper.java   
public JDBC42CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:lams    文件:JDBC4CallableStatementWrapper.java   
public JDBC4CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:lams    文件:JDBC4StatementWrapper.java   
public JDBC4StatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, Statement toWrap) {
    super(c, conn, toWrap);
}
项目:lams    文件:JDBC42PreparedStatementWrapper.java   
public JDBC42PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:ProyectoPacientes    文件:JDBC4PreparedStatementWrapper.java   
public JDBC4PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:ProyectoPacientes    文件:JDBC42CallableStatementWrapper.java   
public JDBC42CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:ProyectoPacientes    文件:JDBC4CallableStatementWrapper.java   
public JDBC4CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:ProyectoPacientes    文件:JDBC4StatementWrapper.java   
public JDBC4StatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, Statement toWrap) {
    super(c, conn, toWrap);
}
项目:ProyectoPacientes    文件:JDBC42PreparedStatementWrapper.java   
public JDBC42PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:BibliotecaPS    文件:JDBC4PreparedStatementWrapper.java   
public JDBC4PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:BibliotecaPS    文件:JDBC42CallableStatementWrapper.java   
public JDBC42CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:BibliotecaPS    文件:JDBC4CallableStatementWrapper.java   
public JDBC4CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:BibliotecaPS    文件:JDBC4StatementWrapper.java   
public JDBC4StatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, Statement toWrap) {
    super(c, conn, toWrap);
}
项目:BibliotecaPS    文件:JDBC42PreparedStatementWrapper.java   
public JDBC42PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:Geometry-wars    文件:JDBC4PreparedStatementWrapper.java   
public JDBC4PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) {
    super(c, conn, toWrap);
}
项目:Geometry-wars    文件:JDBC42CallableStatementWrapper.java   
public JDBC42CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:Geometry-wars    文件:JDBC4CallableStatementWrapper.java   
public JDBC4CallableStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) {
    super(c, conn, toWrap);
}
项目:Geometry-wars    文件:JDBC4StatementWrapper.java   
public JDBC4StatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn, Statement toWrap) {
    super(c, conn, toWrap);
}